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. |
alamb
left a comment
There was a problem hiding this comment.
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_byin primitive sortingCloses #553
Rationale for this change
limitthe k-select is already unstable, we need to be consistentWhat changes are included in this PR?
Are there any user-facing changes?