Skip to content

Commit f7f19d3

Browse files
committed
xfail on old pyarrow
1 parent 7a99bdb commit f7f19d3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/tests/strings/test_find_replace.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
import pytest
66

7+
from pandas.compat import pa_version_under13p0
78
import pandas.util._test_decorators as td
89

910
import pandas as pd
@@ -981,13 +982,22 @@ def test_find_bad_arg_raises(any_string_dtype):
981982
ser.str.rfind(0)
982983

983984

984-
def test_find_nan(any_string_dtype):
985+
def test_find_nan(any_string_dtype, request):
985986
ser = Series(
986987
["ABCDEFG", np.nan, "DEFGHIJEF", np.nan, "XXXX"], dtype=any_string_dtype
987988
)
988989
expected_dtype = (
989990
np.float64 if is_object_or_nan_string_dtype(any_string_dtype) else "Int64"
990991
)
992+
if (
993+
pa_version_under13p0
994+
and isinstance(ser.dtype, pd.StringDtype)
995+
and ser.dtype.storage == "pyarrow"
996+
):
997+
# https://github.com/apache/arrow/issues/36311
998+
mark = pytest.mark.xfail(reason="https://github.com/apache/arrow/issues/36311")
999+
# raises pa.lib.ArrowInvalid with Negative buffer resize
1000+
request.node.add_marker(mark)
9911001

9921002
result = ser.str.find("EF")
9931003
expected = Series([4, np.nan, 1, np.nan, -1], dtype=expected_dtype)

0 commit comments

Comments
 (0)