Skip to content

TST: Add extra test for pandas.to_numeric() for issue #32394 #32560

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

Merged

Conversation

roberthdevries
Copy link
Contributor

@roberthdevries roberthdevries commented Mar 9, 2020

@simonjayhawkins simonjayhawkins added Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Mar 9, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Mar 9, 2020
@jorisvandenbossche jorisvandenbossche changed the title Add extra test for pandas.to_numeric() for issue #32394 TST: Add extra test for pandas.to_numeric() for issue #32394 Mar 9, 2020
@gfyoung gfyoung requested a review from jreback March 10, 2020 21:54
def test_failure_to_convert_uint64_string_to_NaN():
# GH 32394
result = to_numeric("uint64", errors="coerce")
assert np.isnan(result)
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good test, but we generally add the OP example as a test too.

Copy link
Member

Choose a reason for hiding this comment

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

This is basically the OP example, you know, since the first thing that to_numeric does is putting that scalar value in a object array (the bug was about the "uint64" string, not about whether it was passed as a list, series, array or scalar)

@WillAyd
Copy link
Member

WillAyd commented Mar 11, 2020

@jreback

@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

@roberthdevries if you can add the OP test as well here. thanks.

@roberthdevries roberthdevries force-pushed the add-test-to_numeric_issue_32394 branch from b70728e to a30d0ba Compare March 11, 2020 13:51
@roberthdevries
Copy link
Contributor Author

OP test added

@jreback jreback merged commit 74c5306 into pandas-dev:master Mar 15, 2020
@jreback
Copy link
Contributor

jreback commented Mar 15, 2020

thanks @roberthdevries

@roberthdevries roberthdevries deleted the add-test-to_numeric_issue_32394 branch March 15, 2020 07:16
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.to_numeric(..., errors="coerce") failing silently when strings contain "uint64"
6 participants