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(rust, python): don't check sortedness in asof by #8906

Merged
merged 1 commit into from
May 18, 2023
Merged

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented May 18, 2023

fixes #8875

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels May 18, 2023
@ritchie46 ritchie46 merged commit b4730e5 into main May 18, 2023
16 checks passed
@ritchie46 ritchie46 deleted the sorted branch May 18, 2023 09:27
@mkleinbort-ic
Copy link

Sorry, for clarification - does this still check if the items are sorted within the groups?

@ritchie46
Copy link
Member Author

No, it doesn't. That would be O(n), I am not sure how we could elide that

@mkleinbort-ic
Copy link

Mixed feelings about this - especially if we fail on unsorted keys when there is no by parameter, but possibly silently compute the wrong result if the by parameter is used.

I would favor the O(n) cost (checking an array is sorted is not that bad), at least as a default optional

df.join_asof(df2, ...., assume_sorted_keys=False)

For the subset of users that do need the extra milliseconds they can set assume_sorted_keys=True to skip the O(n) check.

alexander-beedie pushed a commit to alexander-beedie/polars that referenced this pull request May 20, 2023
c-peters pushed a commit to c-peters/polars that referenced this pull request Jul 14, 2023
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.

join_asof issues sort warning when items are sorted within groups, but not overall
2 participants