-
Notifications
You must be signed in to change notification settings - Fork 147
feat(DRAFT): Add Expr.sort_by
#2547
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
Draft
dangotbanned
wants to merge
29
commits into
main
Choose a base branch
from
expr-sort-by
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
- Towards #2534 - `Series.sort_by` still doesn't exist
- Skipping 3 examples that we can't do yet - Probably best to trim this down later
- Just repurposed `test_sort_expr` - Wonder if we want to allow sorting by overlapping columns?
Need to flesh out the cases more, but the structure is good for now
Prrety sure `test_sort_by_self` could work, but the simpler case is already handled
Redefined `ArrowExpr.sort_by` in terms that could be used in `EagerExpr`
Reusing other high-level apis has the nice benefit of error handling for free π
Exactly the behavior needed for `first()` #2528 (comment)
Not sure what the issue is https://github.com/narwhals-dev/narwhals/actions/runs/15004869425/job/42160831613?pr=2547
Might be easier to just require `1.0.0` for `Expr.sort_by`? https://github.com/narwhals-dev/narwhals/actions/runs/15005898549/job/42164346613?pr=2547
dangotbanned
commented
May 13, 2025
dangotbanned
added a commit
that referenced
this pull request
May 15, 2025
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.
Closes #2534
What type of PR is this? (check all applicable)
Related issues
Expr.first
Β #2526Expr.sort_by
Β #2534Checklist
If you have comments or can explain your changes, please do so below
Important
Very early version, eager only, but solves the issue in (#2528 (comment))
.over(order_by=...)
rule