Skip to content

Conversation

mroeschke
Copy link
Contributor

Description

Noticed while working on #17644 that diff and fillna were make some unnecessary shallow copies of the grouping.value object. Also noticed that _cov_or_corr just pulled the column names out of grouping.value object, so made a separate API, values_column_names to just create the column names without pulling out the actual columns.

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 Dec 20, 2024
@mroeschke mroeschke self-assigned this Dec 20, 2024
@mroeschke mroeschke requested a review from a team as a code owner December 20, 2024 20:41
@mroeschke mroeschke requested review from bdice and Matt711 December 20, 2024 20:41
@@ -3542,6 +3539,13 @@ def keys(self):
self._key_columns[0], name=self.names[0]
)

@property
def values_column_names(self) -> list[Hashable]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def values_column_names(self) -> list[Hashable]:
def _values_column_names(self) -> list[Hashable]:

Does pandas have this public property? If not, should we just make it a private property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't, so I can make this private

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 756d66b into rapidsai:branch-25.02 Jan 4, 2025
106 checks passed
@mroeschke mroeschke deleted the cln/groupby/shallow_copy branch January 4, 2025 01:29
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
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants