fix: Default engine as streaming for collect_batches#26932
Merged
Conversation
e5d5807 to
0cba00b
Compare
ritchie46
reviewed
Mar 16, 2026
| chunk_size: int | None = None, | ||
| maintain_order: bool = True, | ||
| lazy: bool = False, | ||
| engine: EngineType = "auto", |
Member
There was a problem hiding this comment.
This should remain "auto", but we should decide lower-level where we dispatch to.
ritchie46
reviewed
Mar 16, 2026
| >>> for df in lf.collect_batches(): | ||
| ... print(df) # doctest: +SKIP | ||
| """ | ||
| engine = "streaming" if engine == "auto" else _select_engine(engine) |
Member
There was a problem hiding this comment.
_select_engine should go first as that check engine affinity.`
engine = _select_engine(engine)
engine = "streaming" if engine == "auto" else engine
ritchie46
approved these changes
Mar 16, 2026
ritchie46
pushed a commit
that referenced
this pull request
Mar 16, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26932 +/- ##
==========================================
+ Coverage 81.72% 81.74% +0.01%
==========================================
Files 1806 1806
Lines 248701 248742 +41
Branches 3133 3134 +1
==========================================
+ Hits 203263 203326 +63
+ Misses 44633 44611 -22
Partials 805 805 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2 tasks
davanstrien
pushed a commit
to davanstrien/polars
that referenced
this pull request
Apr 2, 2026
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.
Default to the streaming engine for
collect_batches.Presumably we didn't respect the
engineparameter forcollect_batchesin the past and defaulted to the streaming engine, in this PR we set it explicitly to the streaming engine if it's"auto"