Skip to content

fix(polars): fall back to plain collect when the streaming engine is rejected - #432

Merged
kevincostner17 merged 1 commit into
mainfrom
fix/dependency-floors
Sep 15, 2026
Merged

kevincostner17 merged 1 commit into
mainfrom
fix/dependency-floors

Conversation

@kevincostner17

Copy link
Copy Markdown
Contributor

Summary

The native Polars backend requests collect(engine="streaming") and caught only TypeError. Polars 1.1–1.24 reject that value with ValueError: Invalid engine argument engine='streaming', which propagated and broke fd.clean(df, engine="polars") at the declared polars>=1.0 floor. (Modern polars — and the CI-pinned versions — accept the engine, so this was invisible in CI.)

Change

Broaden the catch in PolarsEngine._collect to (TypeError, ValueError), so an unsupported streaming engine falls back to a plain collect() (correct, just non-streaming), exactly as it already did for the legacy streaming= 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 raises ValueError for engine="streaming" now falls back to a plain collect().

Verification

  • New + existing polars/dispatch tests: 29 passed on Python 3.12 / pandas 2.3.3 and Python 3.9 / pandas 1.5.3.
  • ruff check and mypy clean.

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.

…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).
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4d7f7ea8-d0f1-4925-a10f-43ced314c4d8


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

FreshData benchmark report — performance

  • freshdata: ?
  • python: ?
  • platform: ?
fixture n_rows n_cols p50 s p95 s peak MB repair % false-repair % preserve % trust monotonic export %

Authored-code reduction (Metric 6)

@kevincostner17
kevincostner17 merged commit de25527 into main Sep 15, 2026
22 checks passed
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