Skip to content

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

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

Closed
wants to merge 4 commits into from

Conversation

aidoskanapyanov
Copy link
Contributor

@simonjayhawkins simonjayhawkins added the Reduction Operations sum, mean, min, max, etc. label Feb 13, 2024
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

These would need deprecating first cc @twoertwein

@aidoskanapyanov
Copy link
Contributor Author

aidoskanapyanov commented Feb 13, 2024

Oh, my bad, okay 👌
Gotta learn about deprecating

@twoertwein
Copy link
Member

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

@aidoskanapyanov
Copy link
Contributor Author

Luckily, it is quite simple:

Thank you for explaining, this is super helpful! 👍

Copy link
Contributor

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 github-actions bot added the Stale label Mar 16, 2024
@mroeschke
Copy link
Member

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 mroeschke closed this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reduction Operations sum, mean, min, max, etc. Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.any() inconsistent with other methods
4 participants