Skip to content

CLN: MultiIndex.drop_duplicates #48592

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

Merged
merged 2 commits into from
Sep 19, 2022
Merged

CLN: MultiIndex.drop_duplicates #48592

merged 2 commits into from
Sep 19, 2022

Conversation

twoertwein
Copy link
Member

I think there is no reason why MultiIndex overwrites drop_duplicates from Index:

  • Both implementations do exactly the same
  • Both implementations have exactly the same type annotations
  • MultiIndex.drop_duplicates does not have a doc-string

There are a few more methods (set_names, rename) but in those cases, the annotations might actually be different.

@@ -332,7 +332,7 @@ def test_multi_drop_duplicates_pos_args_deprecation():
idx = MultiIndex.from_arrays([[1, 2, 3, 1], [1, 2, 3, 1]])
msg = (
"In a future version of pandas all arguments of "
"MultiIndex.drop_duplicates will be keyword-only"
"Index.drop_duplicates will be keyword-only"
Copy link
Member

Choose a reason for hiding this comment

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

Okay given that our next release is 2.0 which we can remove this test entirely (otherwise the previous error message was a little better)

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we can adjust the deprecation decorator to always print the current class name

Copy link
Member

Choose a reason for hiding this comment

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

That would be a good enhancement/followup. Mind opening an issue about that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #48650

@mroeschke mroeschke added this to the 1.6 milestone Sep 19, 2022
@mroeschke mroeschke merged commit 3c0215d into pandas-dev:main Sep 19, 2022
@mroeschke
Copy link
Member

Thanks @twoertwein

@twoertwein twoertwein deleted the index branch September 21, 2022 15:29
@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* CLN: MultiIndex.drop_duplicates

* adjust test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants