-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
DEPR: Remove unnecessary kwargs in groupby ops #50483
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
Changes from 14 commits
7ebf822
88ab270
aff453d
4f6548b
2a680be
6569006
3a150f6
519d9da
20c8606
b026a74
dfed625
1676d19
b3ca2f2
90fb8dc
fe8f551
e45c8ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,16 @@ | |
| from pandas.util._decorators import deprecate_nonkeyword_arguments | ||
|
|
||
| import pandas._testing as tm | ||
| from pandas.core.groupby.generic import ( | ||
| skew, | ||
| take, | ||
| ) | ||
| from pandas.core.groupby.groupby import ( | ||
| cummax, | ||
| cummin, | ||
| cumprod, | ||
| cumsum, | ||
| ) | ||
|
|
||
|
|
||
| @deprecate_nonkeyword_arguments( | ||
|
|
@@ -155,3 +165,17 @@ def test_class(): | |
| ) | ||
| with tm.assert_produces_warning(FutureWarning, match=msg): | ||
| Foo().baz("qux", "quox") | ||
|
|
||
|
|
||
| def test_deprecated_keywords(): | ||
|
||
| msg = ( | ||
| "In the future version of pandas the arguments args" | ||
| "and kwargs will be deprecated for these functions" | ||
| ) | ||
| with tm.assert_produces_warning(FutureWarning, match=msg): | ||
| assert cummax | ||
|
||
| assert cummin | ||
| assert cumprod | ||
| assert cumsum | ||
| assert skew | ||
| assert take | ||
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.
Having another look, looks like
deprecate_nonkeyword_argumentsdoesn't deprecate the argument, but makes it usable only via a keyword argument (e.g.foo(1)would produce the warning, butfoo(val=1)wouldn't). If that's the case, doesn't seem like we've got a decorator to simply deprecate an argument. In that case, you'll have to produce it manually.