Skip to content

[Fix] add filter to Polars read parquet + skip BufferPool eviction of unknown objects - #242

Closed
e-strauss wants to merge 2 commits into
deem-data:mainfrom
e-strauss:bugs
Closed

e-strauss wants to merge 2 commits into
deem-data:mainfrom
e-strauss:bugs

Conversation

@e-strauss

Copy link
Copy Markdown
Collaborator

No description provided.

PolarsReadParquet only forwarded `columns` and `storage_options`, so a
pd.read_parquet source that works on pandas broke under
implementation_selector="greedy":

- `filters=` (pyarrow DNF) failed the whole plan at selection time. It is now
  translated to one polars predicate and applied to a scan_parquet before
  projecting `columns`, so pruned hive partitions are never read.
- fsspec `storage_options` (gcsfs `token`, s3fs `key`/`secret`/`anon`) were
  ignored by polars' object store, so cloud reads went out unauthenticated
  (401). They are now mapped to object-store keys; other keys pass through.
- A cloud dataset directory without a trailing slash was looked up as a single
  object (404). Such paths now get the slash polars needs to list them.
The pool admits objects it cannot size (counted as UNKNOWN_SIZE), but the
serializer refuses anything that is not a frame, array, primitive or container
of those. Over budget, eviction picked such an entry -- in practice the splitter
from mark_as_X(cv=...) -- and the ValueError failed the whole plan.

Serialization now raises UnsupportedSpillType and removes leaf files it already
wrote for a container it then gave up on. Eviction catches it, marks the entry
unspillable, keeps it in memory, and moves on to the next LRU candidate.
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.30435% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
stratum/optimizer/physical/_source_execs.py 88.67% 3 Missing and 3 partials ⚠️
Flag Coverage Δ
unittests 92.82% <91.30%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
stratum/runtime/_buffer_pool.py 89.15% <100.00%> (+0.40%) ⬆️
stratum/runtime/_object_serialization.py 96.69% <100.00%> (+0.17%) ⬆️
stratum/optimizer/physical/_source_execs.py 94.30% <88.67%> (-2.18%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

e-strauss added a commit that referenced this pull request Oct 6, 2026
)

PolarsReadParquet only forwarded `columns` and `storage_options`, so a
pd.read_parquet source that works on pandas broke under
implementation_selector="greedy":

- `filters=` (pyarrow DNF) failed the whole plan at selection time. It is now
  translated to one polars predicate and applied to a scan_parquet before
  projecting `columns`, so pruned hive partitions are never read.
- fsspec `storage_options` (gcsfs `token`, s3fs `key`/`secret`/`anon`) were
  ignored by polars' object store, so cloud reads went out unauthenticated
  (401). They are now mapped to object-store keys; other keys pass through.
- A cloud dataset directory without a trailing slash was looked up as a single
  object (404). Such paths now get the slash polars needs to list them.
@e-strauss e-strauss closed this in 20e62ba Oct 6, 2026
@e-strauss
e-strauss deleted the bugs branch October 6, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant