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

ENH: copy keyword to set_axis #47932

Merged
merged 11 commits into from
Aug 17, 2022
Merged

Conversation

jbrockmendel
Copy link
Member

This also opens the option of deprecating inplace here.

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@jbrockmendel
Copy link
Member Author

@Dr-Irv im not clear on what mypy is asking for. help?

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Aug 4, 2022

@Dr-Irv im not clear on what mypy is asking for. help?

I think the issue is as follows. In core/generic.py, you have the inplace argument on the 3rd overload typed as:

inplace: bool_t | lib.NoDefault = ...,

But in series.pyi and frame.pyi, the 3rd overload has:

inplace: bool = ...

You have to make sure the signatures are the same in the superclass and subclass for each overload, and that the declared method (without @overload) has all the possible types of each argument that are specified across all overloads.

@jbrockmendel
Copy link
Member Author

green, booyah

@mroeschke mroeschke added this to the 1.5 milestone Aug 17, 2022
@mroeschke mroeschke merged commit ff441ec into pandas-dev:main Aug 17, 2022
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the perf-set_axis branch August 17, 2022 00:58
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* ENH: copy keyword to set_axis

* GH ref

* fix test

* fix test

* troubleshoot mypy

* mypy fixup

* test inplace=True/copy=False case

* mypy fixup
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.

3 participants