pandas icon indicating copy to clipboard operation
pandas copied to clipboard

BUG: Ensure consistent kwarg only restriction on df.any and df.all

Open aidoskanapyanov opened this issue 1 year ago • 3 comments

  • [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.

aidoskanapyanov avatar Feb 13 '24 05:02 aidoskanapyanov

Oh, my bad, okay 👌 Gotta learn about deprecating

aidoskanapyanov avatar Feb 13 '24 18:02 aidoskanapyanov

Gotta learn about deprecating

Luckily, it is quite simple:

  1. you decorate the method with this: @deprecate_nonkeyword_arguments(version="3.0", allowed_args=["self"], name="all") where name is the name of the method.

  2. Add a whatsnew entry

  3. 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).

twoertwein avatar Feb 14 '24 02:02 twoertwein

Luckily, it is quite simple:

Thank you for explaining, this is super helpful! 👍

aidoskanapyanov avatar Feb 14 '24 03:02 aidoskanapyanov

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.

github-actions[bot] avatar Mar 16 '24 00:03 github-actions[bot]

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.

mroeschke avatar Mar 20 '24 17:03 mroeschke