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

feat: check if by column is sorted, rather than just checking sorted flag, in group_by_dynamic, upsample, and rolling #16494

Merged
merged 1 commit into from
May 28, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented May 26, 2024

#16333 Introduced using Series.is_sorted instead of just checking Series.is_sorted_flag

I'd like to suggest doing the same for group_by_dynamic, rolling and upsample. I think this'll make a noticeable ergonomic difference to users

What's missing is, in the case when it's not sorted, to sort on behalf of the user. That's a bit harder to address, but I think already using Series.is_sorted instead of only checking the sorted flag would already be a positive change for users


Also, I think the current check isn't even correct, as it only checks if the sorted flag doesn't match IsNot, as opposed to checking that it matches Ascending

@MarcoGorelli MarcoGorelli force-pushed the use-is-sorted-more branch 2 times, most recently from 1f41f7b to 6c5fc22 Compare May 26, 2024 09:01
Copy link

codecov bot commented May 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.52%. Comparing base (d856b49) to head (af80d86).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16494      +/-   ##
==========================================
- Coverage   81.53%   81.52%   -0.01%     
==========================================
  Files        1410     1410              
  Lines      185061   185041      -20     
  Branches     2982     2984       +2     
==========================================
- Hits       150885   150853      -32     
- Misses      33660    33672      +12     
  Partials      516      516              

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

@MarcoGorelli MarcoGorelli changed the title use series.is_sorted in rolling/group_by_dynamic/upsample feat: use series.is_sorted in rolling/group_by_dynamic/upsample, rather than just checking sortedness flag May 26, 2024
@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels May 26, 2024
…d flag, in `group_by_dynamic`, `upsample`, and `rolling`
@MarcoGorelli MarcoGorelli marked this pull request as ready for review May 27, 2024 09:08
@MarcoGorelli MarcoGorelli changed the title feat: use series.is_sorted in rolling/group_by_dynamic/upsample, rather than just checking sortedness flag feat: check if by column is sorted, rather than just checking sorted flag, in group_by_dynamic, upsample, and rolling May 27, 2024
@ritchie46 ritchie46 merged commit c56a3cd into pola-rs:main May 28, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature 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