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: Deprecate positional arguments for DataFrame.fillna and Series.fillna (GH41485) #41559

Merged

Conversation

jackzyliu
Copy link
Contributor

@jackzyliu
Copy link
Contributor Author

@MarcoGorelli

I was able to find a few hundreds of DataFrame.fillna or Series.fillna usages, mostly in tests, and didn't see any usages like srs.fillna(0, None) where method and other args are passed in directly as positional. Those usages include a few function calls in string format like here and here. So please let me know if I missed anywhere.

On a separate note, should positional args for Block.fillna also be deprecated?

@MarcoGorelli
Copy link
Member

Nice, thanks!

On a separate note, should positional args for Block.fillna also be deprecated?

The value of inplace doesn't change the return type there, so it's not so crucial for overloads, and I think it's only used internally, so I'm pretty sure it doesn't need changing

@jackzyliu jackzyliu force-pushed the deprecate_nonkeyword_args_fillna branch from 275ed38 to aeb16d9 Compare May 19, 2021 16:25
@jackzyliu
Copy link
Contributor Author

Gotcha!

@jackzyliu jackzyliu force-pushed the deprecate_nonkeyword_args_fillna branch from aeb16d9 to 741df4d Compare May 19, 2021 16:53
@jackzyliu jackzyliu changed the title ENH: Deprecate positional arguments for DataFrame.fillna and Series.fillna ENH: Deprecate positional arguments for DataFrame.fillna and Series.fillna (GH41485) May 19, 2021
@@ -5179,6 +5179,7 @@ def fillna(
) -> DataFrame | None:
...

@deprecate_nonkeyword_arguments(version=None, allowed_args=["self", "value"])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed from "2.0" to None as per reviewer comment in another related PR.

@simonjayhawkins simonjayhawkins added the Deprecate Functionality to remove in pandas label May 21, 2021
@jreback jreback added this to the 1.3 milestone May 21, 2021
@jreback jreback merged commit 04d0e48 into pandas-dev:master May 21, 2021
@jreback
Copy link
Contributor

jreback commented May 21, 2021

thanks @jackzyliu

TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
…illna (GH41485) (pandas-dev#41559)

Co-authored-by: Jack Liu <5811028+zheyuan-liu@users.noreply.github.com>
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
…illna (GH41485) (pandas-dev#41559)

Co-authored-by: Jack Liu <5811028+zheyuan-liu@users.noreply.github.com>
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.

4 participants