-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF/CLN: Parametrize _isna #33835
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
REF/CLN: Parametrize _isna #33835
Conversation
LGTM. _isna_ndarraylike should get a similar treatment; IIRC there is an issue with EAs not handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dsaxton generally lgtm
pandas/core/dtypes/missing.py
Outdated
|
||
|
||
def _isna_old(obj): | ||
def _isna(obj, old: bool = False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to use, say, inf_as_na
= True/False moving forward and remove the old
concept for clarity. (follow-on ok too)
also could maybe use lib.no_default and look up options if not passed instead of the using the callback and partial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree this makes it more clear what is going on
pandas/core/dtypes/missing.py
Outdated
|
||
|
||
def _isna_old(obj): | ||
def _isna(obj, old: bool = False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree this makes it more clear what is going on
Thanks! |
Replaces two nearly identical isna functions with one by parametrizing over the difference