Skip to content

Commit 52a6f52

Browse files
author
Rohan Jain
committed
restore test
1 parent 68763b1 commit 52a6f52

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/extension/test_arrow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,6 +1942,18 @@ def test_str_find_negative_start():
19421942
tm.assert_series_equal(result, expected)
19431943

19441944

1945+
def test_str_find_no_end():
1946+
ser = pd.Series(["abc", None], dtype=ArrowDtype(pa.string()))
1947+
if pa_version_under13p0:
1948+
# https://github.com/apache/arrow/issues/36311
1949+
with pytest.raises(pa.lib.ArrowInvalid, match="Negative buffer resize"):
1950+
ser.str.find("ab", start=1)
1951+
else:
1952+
result = ser.str.find("ab", start=1)
1953+
expected = pd.Series([-1, None], dtype="int64[pyarrow]")
1954+
tm.assert_series_equal(result, expected)
1955+
1956+
19451957
def test_str_find_negative_start_negative_end():
19461958
# GH 56791
19471959
ser = pd.Series(["abcdefg", None], dtype=ArrowDtype(pa.string()))

0 commit comments

Comments
 (0)