Skip to content

Commit f0fff8c

Browse files
authored
TST: to_numeric(large_float, downcast=float) isn't lossy (#48372)
1 parent 9c509e2 commit f0fff8c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/tools/test_to_numeric.py

+8
Original file line numberDiff line numberDiff line change
@@ -799,3 +799,11 @@ def test_to_numeric_scientific_notation():
799799
result = to_numeric("1.7e+308")
800800
expected = np.float64(1.7e308)
801801
assert result == expected
802+
803+
804+
@pytest.mark.parametrize("val", [9876543210.0, 2.0**128])
805+
def test_to_numeric_large_float_not_downcast_to_float_32(val):
806+
# GH 19729
807+
expected = Series([val])
808+
result = to_numeric(expected, downcast="float")
809+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)