Skip to content

POC: NA-only behavior for numpy-nullable dtypes #61708

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbrockmendel
Copy link
Member

This is the first of several POCs stemming from the discussion in #61618. The main goal is to see how invasive it would be.

Specifically, this implements the NaN behavior described in PDEP16 #58988.

Functionally this makes it so that:

  1. With a Float64Dtype or Float32Dtype, you will never get a NaN, only a NA.
  2. Users transitioning from numpy dtypes will be maximally-backwards-compatible

As a result, I expect implementing this would solve most issues labeled as "PDEP missing values". e.g. I just checked and it does address #54876.

@jbrockmendel jbrockmendel added the PDEP missing values Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint label Jun 25, 2025
@jbrockmendel
Copy link
Member Author

Im thinking the check should be done once at dtype instantiation



def using_pdep16_nan_behavior() -> bool:
_mode_options = _global_config["mode"]
Copy link
Member

Choose a reason for hiding this comment

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

As this is a POC, feel free to ignore for now, but if we move forward with this, I would prefer to use future rather than mode, unless we expect to keep the two "modes" indefinitely and allow users to switch between them. Also, we would probably want something different from "pdep16_nan_behavior". Just a comment for future discussion. no need to change now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDEP missing values Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants