Skip to content

REF: Avoid kwargs in rename_axis #51072

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 12 commits into from
Feb 2, 2023

Conversation

mroeschke
Copy link
Member

Unaccepted kwargs already raised a TypeError, so can just replace with the accepted arguments which allows some cleanup

@mroeschke mroeschke added the Refactor Internal refactoring of code label Jan 30, 2023
index=...,
columns=...,
axis: Axis = ...,
copy: bool_t = ...,
Copy link
Member

Choose a reason for hiding this comment

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

can these be keyword-only?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could deprecate and make them keyword only in a follow up, but as is they cannot be yet.

Copy link
Member

Choose a reason for hiding this comment

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

I'm confused - why can't they be made keyword-only?

These arguments (e.g. index) already can't be passed positionally, so which behaviour which currently works would break?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah shoot I misread the previous signature. Yeah these should be able to be keyword only

@mroeschke mroeschke added this to the 2.0 milestone Feb 1, 2023
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.

Lovely, love getting rid of inspect complexities

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

@MarcoGorelli MarcoGorelli merged commit d1fc79d into pandas-dev:main Feb 2, 2023
@mroeschke mroeschke deleted the ref/rename_axis/no_kwargs branch February 2, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants