Skip to content

Commit 2eafd54

Browse files
committed
feat(string): #983 tests for the fix
1 parent a946f6f commit 2eafd54

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/test_indexes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ def test_str_split() -> None:
113113
check(assert_type(ind.str.split("-", expand=True), pd.MultiIndex), pd.MultiIndex)
114114

115115

116+
def test_str_match() -> None:
117+
i = pd.Index(
118+
["applep", "bananap", "Cherryp", "DATEp", "eGGpLANTp", "123p", "23.45p"]
119+
)
120+
check(assert_type(i.str.match("pp"), npt.NDArray[np.bool_]), np.ndarray, np.bool_)
121+
122+
116123
def test_index_rename() -> None:
117124
ind = pd.Index([1, 2, 3], name="foo")
118125
ind2 = ind.rename("goo")

tests/test_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ def test_string_accessors():
14811481
check(assert_type(s.str.ljust(80), pd.Series), pd.Series)
14821482
check(assert_type(s.str.lower(), pd.Series), pd.Series)
14831483
check(assert_type(s.str.lstrip("a"), pd.Series), pd.Series)
1484-
check(assert_type(s.str.match("pp"), pd.Series), pd.Series)
1484+
check(assert_type(s.str.match("pp"), "pd.Series[bool]"), pd.Series, np.bool_)
14851485
check(assert_type(s.str.normalize("NFD"), pd.Series), pd.Series)
14861486
check(assert_type(s.str.pad(80, "right"), pd.Series), pd.Series)
14871487
check(assert_type(s.str.partition("p"), pd.DataFrame), pd.DataFrame)

0 commit comments

Comments
 (0)