Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Jain committed Jan 11, 2024
1 parent 06105ce commit 7fa21eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pandas/tests/extension/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,6 @@ def test_str_find_large_start():
@pytest.mark.xfail(
pa_version_under13p0, reason="https://github.com/apache/arrow/issues/36311"
)
@pytest.mark.parametrize("start", list(range(-15, 15)) + [None])
@pytest.mark.parametrize("end", list(range(-15, 15)) + [None])
@pytest.mark.parametrize(
"sub",
["abcaadef"[x:y] for x, y in combinations(range(len("abcaadef") + 1), r=2)]
Expand All @@ -1990,15 +1988,18 @@ def test_str_find_large_start():
"abce",
],
)
def test_str_find_e2e(start, end, sub):
def test_str_find_e2e(sub):
s = pd.Series(
["abcaadef", "abc", "abcdeddefgj8292", "ab", "a", ""],
dtype=ArrowDtype(pa.string()),
)
object_series = s.astype(pd.StringDtype())
result = s.str.find(sub, start, end)
expected = object_series.str.find(sub, start, end).astype(result.dtype)
tm.assert_series_equal(result, expected)
offsets = list(range(-15, 15)) + [None]
for start in offsets:
for end in offsets:
result = s.str.find(sub, start, end)
expected = object_series.str.find(sub, start, end).astype(result.dtype)
tm.assert_series_equal(result, expected)


def test_str_find_negative_start_negative_end_no_match():
Expand Down

0 comments on commit 7fa21eb

Please sign in to comment.