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

Short circuit some Column methods #16246

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

mroeschke
Copy link
Contributor

Description

Adds some short circuiting, possibly cached checks (e.g. all values unique, no-NAs, monotonicity), to dropna, isnull, notnull, argsort, unique and sort_values allowing these ops to just copy / return a "simplified" result

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jul 10, 2024
@mroeschke mroeschke requested a review from a team as a code owner July 10, 2024 23:21
@mroeschke mroeschke requested review from vyasr and charlesbluca July 10, 2024 23:21
except AttributeError:
# `self.memory_usage` was never called before, So ignore.
pass
attrs = ("memory_usage", "is_monotonic_increasing", "is_monotonic_decreasing")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any places where we need to insert a _clear_cache call that didn't have one before now that these properties are also cached? I did a quick search and didn't find any, but wanted to confirm that you checked too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked and it doesn't looks like there's anywhere we truly modify a Column inplace where these attributes might change (I suspected __setitem__ but it appears it's "inplace" where the base data is swapped)

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 1dd63ea into rapidsai:branch-24.08 Jul 17, 2024
80 checks passed
@mroeschke mroeschke deleted the perf/column/short_circut branch July 17, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants