Skip to content
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

fix: Allow empty sort by columns #18774

Merged
merged 3 commits into from
Sep 18, 2024
Merged

fix: Allow empty sort by columns #18774

merged 3 commits into from
Sep 18, 2024

Conversation

orlp
Copy link
Collaborator

@orlp orlp commented Sep 16, 2024

As I see it, sorting with by=[] is equivalent to sorting using the empty row as key value, and all empty rows are by definition equal. So this should just successfully return the original input. DataFrame.sort already did this, now Expr.sort_by also does.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Sep 16, 2024
@ritchie46
Copy link
Member

I think you must update a test.

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.87%. Comparing base (6561eba) to head (3868fcf).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-core/src/frame/mod.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18774      +/-   ##
==========================================
+ Coverage   79.84%   79.87%   +0.03%     
==========================================
  Files        1518     1518              
  Lines      205576   205615      +39     
  Branches     2892     2892              
==========================================
+ Hits       164132   164231      +99     
+ Misses      40896    40836      -60     
  Partials      548      548              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orlp orlp merged commit 77b1e42 into pola-rs:main Sep 18, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants