pandas
pandas copied to clipboard
BUG: Ensure consistent kwarg only restriction on df.any and df.all
- [x] closes #57087
- [x] Tests added and passed if fixing a bug or adding a new feature
- [x] All code checks passed.
- [ ] Added type annotations to new arguments/methods/functions.
- [ ] Added an entry in the latest
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.
Oh, my bad, okay 👌 Gotta learn about deprecating
Gotta learn about deprecating
Luckily, it is quite simple:
-
you decorate the method with this:
@deprecate_nonkeyword_arguments(version="3.0", allowed_args=["self"], name="all")
wherename
is the name of the method. -
Add a whatsnew entry
-
Ideally, have a test (not sure whether that is needed)
These deprecations apply to both DataFrame and Series for at least the following methods: any, all, min, max, mean, median, sum, prod, std, var, sem, skew, kurt.
I had similar changes in this PR but removed them from the PR to keep it easier to merge. Feel free to have a look at that PR to see how to adjust some of the tests (some of them will fail when you deprecate positional arguments).
Luckily, it is quite simple:
Thank you for explaining, this is super helpful! 👍
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.