Skip to content

Commit

Permalink
xfail on old pyarrow
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Aug 20, 2024
1 parent 025b4d8 commit 66667f6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pandas/tests/strings/test_find_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import pytest

from pandas.compat import pa_version_under13p0
import pandas.util._test_decorators as td

import pandas as pd
Expand Down Expand Up @@ -939,13 +940,22 @@ def test_find_bad_arg_raises(any_string_dtype):
ser.str.rfind(0)


def test_find_nan(any_string_dtype):
def test_find_nan(any_string_dtype, request):
ser = Series(
["ABCDEFG", np.nan, "DEFGHIJEF", np.nan, "XXXX"], dtype=any_string_dtype
)
expected_dtype = (
np.float64 if is_object_or_nan_string_dtype(any_string_dtype) else "Int64"
)
if (
pa_version_under13p0
and isinstance(ser.dtype, pd.StringDtype)
and ser.dtype.storage == "pyarrow"
):
# https://github.com/apache/arrow/issues/36311
mark = pytest.mark.xfail(reason="https://github.com/apache/arrow/issues/36311")
# raises pa.lib.ArrowInvalid with Negative buffer resize
request.node.add_marker(mark)

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

0 comments on commit 66667f6

Please sign in to comment.