Skip to content

Commit 33cd407

Browse files
committed
xfail on old pyarrow
1 parent b863dcb commit 33cd407

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
@@ -939,13 +940,22 @@ def test_find_bad_arg_raises(any_string_dtype):
939940
ser.str.rfind(0)
940941

941942

942-
def test_find_nan(any_string_dtype):
943+
def test_find_nan(any_string_dtype, request):
943944
ser = Series(
944945
["ABCDEFG", np.nan, "DEFGHIJEF", np.nan, "XXXX"], dtype=any_string_dtype
945946
)
946947
expected_dtype = (
947948
np.float64 if is_object_or_nan_string_dtype(any_string_dtype) else "Int64"
948949
)
950+
if (
951+
pa_version_under13p0
952+
and isinstance(ser.dtype, pd.StringDtype)
953+
and ser.dtype.storage == "pyarrow"
954+
):
955+
# https://github.com/apache/arrow/issues/36311
956+
mark = pytest.mark.xfail(reason="https://github.com/apache/arrow/issues/36311")
957+
# raises pa.lib.ArrowInvalid with Negative buffer resize
958+
request.node.add_marker(mark)
949959

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

0 commit comments

Comments
 (0)