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 naming issues with Index.to_frame and MultiIndex.to_frame APIs #14105

Merged
merged 9 commits into from
Sep 13, 2023

Conversation

galipremsagar
Copy link
Contributor

Fixes: #14085

Description

This PR:

  • Introduces allow_duplicates for parity with MultiIndex.to_frame - however this parameter is non-functional since cudf doesn't support duplicate column names.
  • Fixed handling of duplicate index names in MultiIndex.to_frame
  • Added proper docs for Index.to_frame & MultiIndex.to_frame separately due to change in API signature.
  • Added tests for Index.to_frame & MultiIndex.to_frame
  • Introduced deprecations that will go away when pandas-2.0 support is enabled.

Checklist

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

@galipremsagar galipremsagar added bug Something isn't working 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. 4 - Needs cuDF (Python) Reviewer non-breaking Non-breaking change labels Sep 13, 2023
@galipremsagar galipremsagar self-assigned this Sep 13, 2023
@galipremsagar galipremsagar requested a review from a team as a code owner September 13, 2023 17:54
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Some small-ish changes requested but non-blocking. It looks like the differences in behavior are somewhat subtle but they look correct.

python/cudf/cudf/core/multiindex.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/multiindex.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/multiindex.py Outdated Show resolved Hide resolved
python/cudf/cudf/core/multiindex.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_multiindex.py Outdated Show resolved Hide resolved
@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Sep 13, 2023
@galipremsagar
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 60009a8 into rapidsai:branch-23.10 Sep 13, 2023
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] MultiIndex.to_frame not throwing an error for duplicate names
3 participants