Skip to content

Commit cab3a0e

Browse files
pv8473h12jreback
authored andcommitted
GH14422: BUG: to_numeric doesn't work uint64 numbers (#29348)
1 parent 11e60d7 commit cab3a0e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pandas/tests/tools/test_numeric.py

+18
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,24 @@ def test_downcast_limits(dtype, downcast, min_max):
567567
assert series.dtype == dtype
568568

569569

570+
@pytest.mark.parametrize(
571+
"ser,expected",
572+
[
573+
(
574+
pd.Series([0, 9223372036854775808]),
575+
pd.Series([0, 9223372036854775808], dtype=np.uint64),
576+
)
577+
],
578+
)
579+
def test_downcast_uint64(ser, expected):
580+
# see gh-14422:
581+
# BUG: to_numeric doesn't work uint64 numbers
582+
583+
result = pd.to_numeric(ser, downcast="unsigned")
584+
585+
tm.assert_series_equal(result, expected)
586+
587+
570588
@pytest.mark.parametrize(
571589
"data,exp_data",
572590
[

0 commit comments

Comments
 (0)