-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use sort_unstable_by in primitive sorting #552
Conversation
Codecov Report
@@ Coverage Diff @@
## master #552 +/- ##
=======================================
Coverage 82.47% 82.47%
=======================================
Files 167 167
Lines 46142 46142
=======================================
Hits 38056 38056
Misses 8086 8086
Continue to review full report at Codecov.
|
|
I think that this is backward incompatible since the sorted indices are now different between implementations, It is a semantic, not an API, backward incompatibility. See https://stackoverflow.com/questions/1517793/what-is-stability-in-sorting-algorithms-and-why-is-it-important if you are interested in the why it is important. |
agree that it's API change. and also it's an improvement of consistency because somehow the sort with limit has been unstable. if needed we can add a stable sort alternative later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. I think we should also update the docstring so it no longer says the sort is stable:
/// Sort the `ArrayRef` using `SortOptions`.
///
/// Performs a stable sort on values and indices. Nulls are ordered according to the `nulls_first` flag in `options`.
/// Floats are sorted using IEEE 754 totalOrder
///
Thanks @jimexist |
I will update the docstring in a follow on PR -- I am trying to keep the merge queue down |
Thanks again @jimexist |
Doc update proposed in #572 |
Which issue does this PR close?
use
sort_unstable_by
in primitive sortingCloses #553
Rationale for this change
limit
the k-select is already unstable, we need to be consistentWhat changes are included in this PR?
Are there any user-facing changes?