Skip to content

Commit 74c5306

Browse files
TST: Add extra test for pandas.to_numeric() for issue #32394 (#32560)
1 parent 2e114ce commit 74c5306

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/tools/test_to_numeric.py

+10
Original file line numberDiff line numberDiff line change
@@ -627,3 +627,13 @@ def test_non_coerce_uint64_conflict(errors, exp):
627627
else:
628628
result = to_numeric(ser, errors=errors)
629629
tm.assert_series_equal(result, ser)
630+
631+
632+
def test_failure_to_convert_uint64_string_to_NaN():
633+
# GH 32394
634+
result = to_numeric("uint64", errors="coerce")
635+
assert np.isnan(result)
636+
637+
ser = Series([32, 64, np.nan])
638+
result = to_numeric(pd.Series(["32", "64", "uint64"]), errors="coerce")
639+
tm.assert_series_equal(result, ser)

0 commit comments

Comments
 (0)