fix: Propagate null in min_by / max_by for all-null by groups#26919
Merged
orlp merged 3 commits intopola-rs:mainfrom Mar 16, 2026
Merged
fix: Propagate null in min_by / max_by for all-null by groups#26919orlp merged 3 commits intopola-rs:mainfrom
min_by / max_by for all-null by groups#26919orlp merged 3 commits intopola-rs:mainfrom
Conversation
be914aa to
fb8e650
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26919 +/- ##
=======================================
Coverage 81.73% 81.74%
=======================================
Files 1806 1806
Lines 248701 248703 +2
Branches 3133 3133
=======================================
+ Hits 203287 203298 +11
+ Misses 44609 44600 -9
Partials 805 805 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ritchie46
pushed a commit
that referenced
this pull request
Mar 16, 2026
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.
Fixes : #26918
Previously,
into_no_null_iter()was used on the nullable index result fromagg_arg_min/agg_arg_max. That iterator reads raw values fromdata_views()without checking the validity bitmap, so null entries were treated as their underlying raw buffer value. In this case that became0, which caused all-null groups to gather the group’s first element.I fixed this by switching to
iter()so the indices stay asOption<IdxSize>through the mapping step, and by usingtake_unchecked(&IdxCa), which propagates null indices to null outputs.