Skip to content

Commit f543e5d

Browse files
committed
TST: to_numeric raise ValueError when the arrow array contains NA
1 parent 048979f commit f543e5d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/tools/test_to_numeric.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,3 +919,14 @@ def test_coerce_pyarrow_backend():
919919
result = to_numeric(ser, errors="coerce", dtype_backend="pyarrow")
920920
expected = Series([1, 2, None], dtype=ArrowDtype(pa.int64()))
921921
tm.assert_series_equal(result, expected)
922+
923+
924+
def test_to_numeric_arrow_decimal_with_na():
925+
# GH 61641
926+
pa = pytest.importorskip("pyarrow")
927+
decimal_type = ArrowDtype(pa.decimal128(3, scale=2))
928+
series = Series([1, None], dtype=decimal_type)
929+
result = to_numeric(series, errors="coerce")
930+
931+
expected = Series([1.00, pd.NA], dtype=decimal_type)
932+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)