@@ -250,7 +250,7 @@ def row_count(self, missing_ok: bool = False) -> int:
250250 raise
251251 return dt .count ()
252252
253- def table_exists (self ) -> bool :
253+ def delta_log_exists (self ) -> bool :
254254 """Return True when a Delta log is present at this location.
255255
256256 Used to decide whether a cached fixture (see ``stable_subpath``) can
@@ -262,11 +262,13 @@ def table_exists(self) -> bool:
262262 return False
263263
264264 def _place_tree (self , staging : pathlib .Path ) -> None :
265- """Place a locally-built Delta table tree onto this location's backend.
265+ """Copy a locally-built Delta table tree to where this location stores
266+ its data: the local directory, or the S3/MinIO bucket, depending on
267+ how this location was created.
266268
267269 Some fixtures can only be produced on the local filesystem (e.g. a
268- PySpark-written table) yet must be read back from the configured
269- backend. Local targets are replaced wholesale; S3/MinIO targets get
270+ PySpark-written table). For a local target, any existing content at
271+ ``self.local_dir`` is deleted before the copy. S3/MinIO targets get
270272 the data files first and ``_delta_log`` last, so a reader observing
271273 the upload mid-flight never sees a log referencing a missing parquet.
272274 """
@@ -316,23 +318,28 @@ def ensure_delta_spark_fixture(
316318 wheel. This builds such a fixture once and reuses it:
317319
318320 * If the fixture is already present (``is_present``, defaulting to
319- :meth:`DeltaTestLocation.table_exists `), do nothing — so a
321+ :meth:`DeltaTestLocation.delta_log_exists `), do nothing — so a
320322 ``stable_subpath`` cache is reused across runs.
321323 * Otherwise run ``builder_script`` in an isolated environment
322- (``uv run --with <delta_spark_spec> python <builder_script> <staging>
323- *builder_args``), staging into a temp dir so a half-finished build can
324- never leak into the upload, then place the tree onto ``loc``'s backend.
324+ (``uv run --no-project --with <delta_spark_spec> python <builder_script>
325+ <staging> *builder_args``), staging into a temp dir so a half-finished
326+ build can never leak into the upload, then place the tree onto ``loc``'s
327+ backend. ``--no-project`` keeps the builder hermetic: it depends only on
328+ ``delta_spark_spec``, never on building the enclosing project.
325329
326330 The heavy PySpark + JVM stack is pulled only on this rare rebuild path.
327331
328332 :param builder_script: Path to a standalone script that writes a Delta
329333 table to the directory given as its first argument.
330334 :param builder_args: Extra positional arguments passed after the staging
331- directory (stringified).
335+ directory. Each is stringified verbatim with ``str()`` — pass
336+ primitives; ``None`` would become the literal string ``"None"``.
332337 :param is_present: Predicate deciding whether the fixture already exists;
333338 also re-checked after upload to catch partial uploads.
334339 """
335- present = is_present if is_present is not None else DeltaTestLocation .table_exists
340+ present = (
341+ is_present if is_present is not None else DeltaTestLocation .delta_log_exists
342+ )
336343 if present (loc ):
337344 return
338345
@@ -348,6 +355,7 @@ def ensure_delta_spark_fixture(
348355 [
349356 "uv" ,
350357 "run" ,
358+ "--no-project" ,
351359 "--with" ,
352360 delta_spark_spec ,
353361 "python" ,
@@ -363,8 +371,8 @@ def ensure_delta_spark_fixture(
363371
364372 if not present (loc ):
365373 raise RuntimeError (
366- f"Delta fixture at { loc .uri } is still absent after upload — "
367- "partial upload, or content-stripping middleware? "
374+ f"Delta fixture at { loc .uri } is still absent after the builder "
375+ "ran and the tree was uploaded. "
368376 )
369377
370378
0 commit comments