-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
REF: Avoid kwargs in rename_axis #51072
Conversation
pandas/core/generic.py
Outdated
index=..., | ||
columns=..., | ||
axis: Axis = ..., | ||
copy: bool_t = ..., |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Unaccepted kwargs already raised a
TypeError
, so can just replace with the accepted arguments which allows some cleanup