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

DEPR: downcasting in NDFrame.where, mask, clip #53656

Merged
merged 13 commits into from
Sep 1, 2023

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Jun 13, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • 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.

Related to #40988.

This doesn't have a good "do X to avoid the warning/get the future behavior". Could be a use case for the "future" option from #53025

Alternative to #53108

@jbrockmendel
Copy link
Member Author

@rhshadrach thoughts here?

@rhshadrach
Copy link
Member

rhshadrach commented Jul 10, 2023

+1 on the future behavior.

Agree this is a good candidate for a future.* option. The other option would be to add an argument to Series.where and DataFrame.where for the change in behavior. The benefit of the argument would be that it doesn't rely on global state and is more explicit. The downside is that users can't just adopt the future behavior everywhere in a single line of code. No clear winner in my mind - I'm good either way.

Edit: I forgot this was impacting multiple methods. That makes me favor the option rather than argument quite a bit more.

@jbrockmendel
Copy link
Member Author

@mroeschke @MarcoGorelli on board for implementing the future option here?

@MarcoGorelli
Copy link
Member

yeah sounds good to me!

@MarcoGorelli
Copy link
Member

implementing the future option here?

is that something you want to do as part of this PR?

@jbrockmendel
Copy link
Member Author

is that something you want to do as part of this PR?

I was planning to, yes. But if people were OK on doing this deprecation without a "do X instead" id also be happy do move forward as is

@gfyoung gfyoung added the Deprecate Functionality to remove in pandas label Aug 17, 2023
@jbrockmendel
Copy link
Member Author

@mroeschke thoughts here? im making a push to deprecate all our remaining silent downcasting and this is the hard one i think. im OK either to do this without a "do X instead" or to implement a "future" option.

@mroeschke
Copy link
Member

I think being more conservative with a future option would be better here since there seem to be no current way to work around this warning.

@jbrockmendel
Copy link
Member Author

I think being more conservative with a future option would be better here since there seem to be no current way to work around this warning.

updated with future option. could plausibly re-use that in #54710, #54261

@mroeschke mroeschke added this to the 2.2 milestone Sep 1, 2023
@mroeschke mroeschke merged commit 80a1a8b into pandas-dev:main Sep 1, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Sep 11, 2023
* DEPR: downcasting in NDFrame.where, mask, clip

* GH ref

* suppress warning in doctet

* add caller

* implement future.no_silent_downcasting

* move whatsnew to 2.2
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.

5 participants