Skip to content

Commit cf26a93

Browse files
update test
1 parent df31bfd commit cf26a93

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/strings/test_strings.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
import numpy as np
77
import pytest
88

9+
from pandas.compat import pa_version_under21p0
10+
911
from pandas import (
1012
NA,
1113
DataFrame,
1214
Index,
1315
MultiIndex,
1416
Series,
17+
StringDtype,
1518
option_context,
1619
)
1720
import pandas._testing as tm
@@ -264,6 +267,16 @@ def test_isnumeric_unicode(method, expected, any_string_dtype):
264267
"bool" if is_object_or_nan_string_dtype(any_string_dtype) else "boolean"
265268
)
266269
expected = Series(expected, dtype=expected_dtype)
270+
if (
271+
method == "isdigit"
272+
and isinstance(ser.dtype, StringDtype)
273+
and ser.dtype.storage == "pyarrow"
274+
and not pa_version_under21p0
275+
):
276+
# known difference in behavior between python and pyarrow unicode handling
277+
# pyarrow 21+ considers ¼ as a digit, while python does not
278+
expected.iloc[3] = True
279+
267280
result = getattr(ser.str, method)()
268281
tm.assert_series_equal(result, expected)
269282

0 commit comments

Comments
 (0)