fix(polars): fall back to plain collect when the streaming engine is rejected - #432
Merged
Merged
Conversation
…cted The native Polars backend requested collect(engine="streaming") and caught only TypeError, but polars 1.1-1.24 reject the value with ValueError (Invalid engine argument), which propagated and broke fd.clean on the declared polars floor. Broaden the catch to (TypeError, ValueError) so those versions fall back to a plain collect(); modern polars, which accepts the engine, is unchanged. Found by the production-readiness campaign (FDC-L1b-001).
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FreshData benchmark report —
|
| fixture | n_rows | n_cols | p50 s | p95 s | peak MB | repair % | false-repair % | preserve % | trust | monotonic | export % |
|---|
Authored-code reduction (Metric 6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The native Polars backend requests
collect(engine="streaming")and caught onlyTypeError. Polars 1.1–1.24 reject that value withValueError: Invalid engine argument engine='streaming', which propagated and brokefd.clean(df, engine="polars")at the declaredpolars>=1.0floor. (Modern polars — and the CI-pinned versions — accept the engine, so this was invisible in CI.)Change
Broaden the catch in
PolarsEngine._collectto(TypeError, ValueError), so an unsupported streaming engine falls back to a plaincollect()(correct, just non-streaming), exactly as it already did for the legacystreaming=keyword. No behaviour change on any polars that accepts the engine.Tests
tests/test_execution/test_dispatch_and_config.py: a fake lazy frame that raisesValueErrorforengine="streaming"now falls back to a plaincollect().Verification
ruff checkandmypyclean.Found by the production-readiness campaign (lane L1b, FDC-L1b-001). Two related floor findings are being handled separately: FDC-L1b-002 (scikit-learn 1.0.2 + missforest) and FDC-L1b-003 (pandas 2.0/2.1 nullable-Int64 band) — see the campaign report; both may call for a floor bump rather than a code change.