fix(rust): Incorrect arg_sort with descending+limit#26839
Merged
nameexhaustion merged 3 commits intopola-rs:mainfrom Mar 10, 2026
Merged
fix(rust): Incorrect arg_sort with descending+limit#26839nameexhaustion merged 3 commits intopola-rs:mainfrom
nameexhaustion merged 3 commits intopola-rs:mainfrom
Conversation
When arg_sort is called with descending=true and a limit, select_nth_unstable_by was always using the ascending comparator to partition elements. This caused the wrong N elements to be selected (smallest instead of largest). Reverse the comparator when descending is set in both arg_sort and arg_sort_no_nulls functions. Closes pola-rs#26833 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8a713ba to
91f7251
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26839 +/- ##
==========================================
+ Coverage 81.00% 81.68% +0.68%
==========================================
Files 1805 1805
Lines 248021 248066 +45
Branches 3132 3132
==========================================
+ Hits 200902 202635 +1733
+ Misses 46313 44625 -1688
Partials 806 806 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nameexhaustion
approved these changes
Mar 10, 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.
Summary
Closes #26833
Test plan