-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Deprecate passing args as positional in DataFrame/Series.interpolate #41510
Deprecate passing args as positional in DataFrame/Series.interpolate #41510
Conversation
3fe733d
to
91ec0d6
Compare
91ec0d6
to
f1ac08b
Compare
r"for the argument 'self' will be keyword-only" | ||
) | ||
with tm.assert_produces_warning(FutureWarning, match=msg): | ||
ser.interpolate(0) |
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 would have expected this to raise a TypeError.
ser = Series([1, 2, 3]) | ||
msg = ( | ||
r"Starting with Pandas version 2\.0 all arguments of interpolate except " | ||
r"for the argument 'self' will 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.
message doesn't need to mention self
Maybe allow |
7b6ee76
to
a748a15
Compare
3f6e43b
to
e1e0948
Compare
can you rebase |
…ord-args-interpolate
thanks @MarcoGorelli |
@MarcoGorelli if you wouldn't mind adding these to the deprecations list see #30228 (I added this one). also after these are 'done', it may make sense to make a separate deprecation section and/or normalize the language for these in the whatsnew. |
downcast, | ||
**kwargs, | ||
) | ||
|
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.
if deprecate_nonkeyword_arguments is updated to accept a class argument then maybe could do something like
interpolate = deprecate_nonkeyword_arguments(
version=None, allowed_args=["self", "method"], class="DataFrame"
)(NDFrame.interpolate)
will do - and yes, once they're in I'll sort out the whatsnew entry |
inplace
#41485