-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: to_numpy #41751
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
TYP: to_numpy #41751
Conversation
jbrockmendel
commented
May 31, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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 @jbrockmendel Is this not covered by one of @Dr-Irv PRs?
@@ -191,7 +191,7 @@ def extract_bool_array(mask: ArrayLike) -> np.ndarray: | |||
# We could have BooleanArray, Sparse[bool], ... | |||
# Except for BooleanArray, this is equivalent to just | |||
# np.asarray(mask, dtype=bool) | |||
mask = mask.to_numpy(dtype=bool, na_value=False) | |||
mask = mask.to_numpy(dtype=np.dtype("bool"), na_value=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.
this shouldn't need to be changed. Not sure without checking when the NpDtype alias was added, but pretty sure from memory that this is causing several issues (e.g. #41203 (review)) and needs to be fixed first. #41185
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.
either way i guess. at some point it is going to be cast to a np.dtype object, so i see it as harmless
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.
yes, but the change means that the to_numpy annotation is wrong and since it's public will give false positives to users.
I haven't done |
if this is handled elsewhere we can just close it |