-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Fix failure to convert string "uint64" to NaN #32541
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
Fix failure to convert string "uint64" to NaN #32541
Conversation
Including regression test
955550d
to
0240f9c
Compare
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.
lgtm - @gfyoung care to look?
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.
Nice!
The fix I had back then was good, but I guess not all patches age well...
Great thanks @roberthdevries - keep the PRs coming! |
result = lib.maybe_convert_numeric( | ||
np.array(["uint64"], dtype=object), set(), coerce_numeric=True | ||
) | ||
assert np.isnan(result) |
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 is not a good test - does it replicate what the OP was? this is not user facing at all
pls follow what is going on in other tests
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.
The OP currently takes this path, though it'd be good to test at the pd.to_numeric
level too.
@WillAyd this has a number of issues in testing pls revert the OP is not tested at all |
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.
If the issue is just lack of tests I think we can push that in an additional PR, rather than reverting.
result = lib.maybe_convert_numeric( | ||
np.array(["uint64"], dtype=object), set(), coerce_numeric=True | ||
) | ||
assert np.isnan(result) |
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.
The OP currently takes this path, though it'd be good to test at the pd.to_numeric
level too.
right just need another PR; @roberthdevries can u push a test for to_numeric @WillAyd remember to set the version in the PR and issue before merging |
@jreback I will add another PR with a test for to_numeric referencing the original issue |
Including regression test
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff