Repository navigation
Fix bug where non-order keyword arguments are passed from sort! to searchsortedfirst - #335
Conversation
…`searchsortedfirst`
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #335 +/- ##
==========================================
+ Coverage 93.68% 93.78% +0.10%
==========================================
Files 12 12
Lines 7454 7464 +10
==========================================
+ Hits 6983 7000 +17
+ Misses 471 464 -7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| searchsortedfirst_discard_keywords(v::AbstractVector, x; lt=isless, by=identity, | ||
| rev::Union{Bool,Nothing}=nothing, order::Base.Order.Ordering=Forward, kws...) = | ||
| searchsortedfirst(v,x,Base.Order.ord(lt,by,rev,order)) | ||
| function sort!(x::AbstractCompressedVector; kws...) |
There was a problem hiding this comment.
Why not apply the same trick to sort! directly?
There was a problem hiding this comment.
I want sort!(sprand(10, .1), banana=:blue) to continue to error.
There was a problem hiding this comment.
Makes sense. Judging from the code, however, I don't quite see where that call would throw.
There was a problem hiding this comment.
It should throw at sort!(nz; kws...). I'll also add a test.
|
Ok to merge? |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.9 1.9
# Navigate to the new working tree
cd .worktrees/backport-1.9
# Create a new branch
git switch --create backport-335-to-1.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 38604c3b9f80059f108b196853d2ab9f9956c986
# Push it to GitHub
git push --set-upstream origin backport-335-to-1.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.9Then, create a pull request where the |
Silently ignore unrecognized keywords when finding the first index of zero. If stray keywords are passed, they will still cause the inner
sort!to throw.Fixes #334
Backport because I introduced this bug in 1.9 in #303.