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

Preserve column metadata during more DataFrame operations #15519

Merged
merged 11 commits into from
May 3, 2024

Conversation

mroeschke
Copy link
Contributor

Description

Supersedes #15410, adds a ColumnAccessor._from_columns_like_self that will preserve column attributes during DataFrame operations. This can wholly replace _from_data_like_self

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 Apr 12, 2024
@mroeschke mroeschke requested a review from a team as a code owner April 12, 2024 00:52

return self._mimic_inplace(
self._from_data_like_self(out), inplace=inplace
self._from_data_like_self(self._data._from_columns_like_self(out)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I still see a number of instances of _from_data_like_self. Can we use _from_data instead consistently now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we use _from_data instead consistently now?

Getting there but not quite yet due to preserving the index. IndexedFrame._from_data_like_self is like _from_data but preserves the existing index which IndexedFrame._from_data doesn't do by default.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

Minor docstring nit, thanks for the continued refactoring and cleanups!

python/cudf/cudf/core/column_accessor.py Show resolved Hide resolved
@wence-
Copy link
Contributor

wence- commented May 3, 2024

/merge

@rapids-bot rapids-bot bot merged commit a27feab into rapidsai:branch-24.06 May 3, 2024
78 checks passed
@mroeschke mroeschke deleted the ref/preserve_column/1 branch May 3, 2024 16:55
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