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

DEP: Enforce set_values and set_codes inplace and positional args deprecation #49084

Merged
merged 7 commits into from
Oct 20, 2022

Conversation

phofl
Copy link
Member

@phofl phofl commented Oct 14, 2022

@phofl phofl added MultiIndex Deprecate Functionality to remove in pandas labels Oct 14, 2022
@phofl phofl added this to the 2.0 milestone Oct 14, 2022
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

minor items otherwise lgtm

pandas/tests/indexes/multi/test_compat.py Outdated Show resolved Hide resolved
pandas/tests/indexes/multi/test_compat.py Outdated Show resolved Hide resolved
@@ -254,12 +251,10 @@ def test_is_():
mi4 = mi3.view()

# GH 17464 - Remove duplicate MultiIndex levels
with tm.assert_produces_warning(FutureWarning):
mi4.set_levels([list(range(10)), list(range(10))], inplace=True)
mi4 = mi4.set_levels([list(range(10)), list(range(10))])
Copy link
Member

Choose a reason for hiding this comment

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

Similar comment - might be able to just remove

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit different, would like to keep it

@@ -145,7 +145,8 @@ Deprecations
Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Disallow passing non-round floats to :class:`Timestamp` with ``unit="M"`` or ``unit="Y"`` (:issue:`47266`)
-
- Remove argument ``inplace`` from :meth:`MultiIndex.set_levels` and :meth:`MultiIndex.set_codes` (:issue:`35626`)
- Disallow passing positional arguments to :meth:`MultiIndex.set_levels` and :meth:`MultiIndex.set_codes` (:issue:`41485`)
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test where set_levels and set_codes raises when passed positional args?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm @mroeschke merge when happy

@mroeschke mroeschke merged commit 52acf97 into pandas-dev:main Oct 20, 2022
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the dep_midx_inplace branch October 21, 2022 21:33
phofl added a commit to phofl/pandas that referenced this pull request Oct 21, 2022
…recation (pandas-dev#49084)

* DEP: Enforce set_values and set_codes inplace and positional args deprecation

* Fix

* Add whatsnew

* Add test
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…recation (pandas-dev#49084)

* DEP: Enforce set_values and set_codes inplace and positional args deprecation

* Fix

* Add whatsnew

* Add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants