Skip to content

Commit 8e226cd

Browse files
committed
BUG: Fix Series.str.contains with compiled regex on Arrow string dtype (#61942) and add whatsnew note
1 parent 8fc81e0 commit 8e226cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/tests/strings/test_strings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
import numpy as np
88
import pytest
99

10-
import pandas as pd
10+
pytest.importorskip("pyarrow")
11+
1112
from pandas import (
13+
NA,
1214
DataFrame,
1315
Index,
1416
MultiIndex,
@@ -179,10 +181,11 @@ def test_empty_str_methods(any_string_dtype):
179181

180182

181183
def test_str_contains_compiled_regex_arrow():
184+
# GH#61942
182185
ser = Series(["foo", "bar", "baz", None], dtype="string[pyarrow]")
183186
pat = re.compile(r"ba.")
184187
result = ser.str.contains(pat)
185-
expected = Series([False, True, True, pd.NA], dtype="boolean[pyarrow]")
188+
expected = Series([False, True, True, NA], dtype="boolean[pyarrow]")
186189
tm.assert_series_equal(result, expected)
187190

188191

0 commit comments

Comments
 (0)