Skip to content

Commit 0349837

Browse files
committed
Add test
1 parent 6320c8b commit 0349837

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/extension/test_arrow.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,16 @@ def test_str_split_pat_none(method):
22962296
tm.assert_series_equal(result, expected)
22972297

22982298

2299+
def test_str_split_regex_none():
2300+
# GH 58321
2301+
ser = pd.Series(["230/270/270", "240-290-290"], dtype=ArrowDtype(pa.string()))
2302+
result = ser.str.split(r"/|-", regex=None)
2303+
expected = pd.Series(
2304+
ArrowExtensionArray(pa.array([["230", "270", "270"], ["240", "290", "290"]]))
2305+
)
2306+
tm.assert_series_equal(result, expected)
2307+
2308+
22992309
def test_str_split():
23002310
# GH 52401
23012311
ser = pd.Series(["a1cbcb", "a2cbcb", None], dtype=ArrowDtype(pa.string()))

0 commit comments

Comments
 (0)