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

Deprecate passing args as positional in DataFrame/Series.interpolate #41510

Merged

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli force-pushed the deprecate-nonkeyword-args-interpolate branch from 3fe733d to 91ec0d6 Compare May 16, 2021 13:51
@MarcoGorelli MarcoGorelli force-pushed the deprecate-nonkeyword-args-interpolate branch from 91ec0d6 to f1ac08b Compare May 16, 2021 13:53
r"for the argument 'self' will be keyword-only"
)
with tm.assert_produces_warning(FutureWarning, match=msg):
ser.interpolate(0)
Copy link
Member

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"
Copy link
Member

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

@simonjayhawkins simonjayhawkins added the Deprecate Functionality to remove in pandas label May 17, 2021
@jorisvandenbossche
Copy link
Member

Maybe allow method to be positional?

@jorisvandenbossche jorisvandenbossche changed the title deprecate nonkeywordargs in interpolate Deprecate passing args as positional in DataFrame/Series.interpolate May 17, 2021
@MarcoGorelli MarcoGorelli force-pushed the deprecate-nonkeyword-args-interpolate branch from 7b6ee76 to a748a15 Compare May 17, 2021 20:28
@MarcoGorelli MarcoGorelli marked this pull request as draft May 18, 2021 08:14
@MarcoGorelli MarcoGorelli marked this pull request as ready for review May 18, 2021 20:33
@MarcoGorelli MarcoGorelli force-pushed the deprecate-nonkeyword-args-interpolate branch from 3f6e43b to e1e0948 Compare May 18, 2021 20:34
@jreback
Copy link
Contributor

jreback commented May 19, 2021

can you rebase

@jreback jreback added this to the 1.3 milestone May 19, 2021
@jreback jreback merged commit a395185 into pandas-dev:master May 19, 2021
@jreback
Copy link
Contributor

jreback commented May 19, 2021

thanks @MarcoGorelli

@jreback
Copy link
Contributor

jreback commented May 19, 2021

@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,
)

Copy link
Member

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)

@MarcoGorelli MarcoGorelli deleted the deprecate-nonkeyword-args-interpolate branch May 23, 2021 20:38
@MarcoGorelli
Copy link
Member Author

will do - and yes, once they're in I'll sort out the whatsnew entry

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants