Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas-stubs/core/strings.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS]):
def get(self, i: int) -> T: ...
def join(self, sep: str) -> T: ...
def contains(
self, pat: str, case: bool = ..., flags: int = ..., na=..., regex: bool = ...
self, pat: str | re.Pattern, case: bool = ..., flags: int = ..., na=..., regex: bool = ...
) -> Series[bool]: ...
def match(
self, pat: str, case: bool = ..., flags: int = ..., na: Any = ...
Expand Down
1 change: 1 addition & 0 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@ def test_string_accessors():
check(assert_type(s.str.cat(sep="X"), str), str)
check(assert_type(s.str.center(10), pd.Series), pd.Series)
check(assert_type(s.str.contains("a"), "pd.Series[bool]"), pd.Series, np.bool_)
check(assert_type(s.str.contains(re.compile(r"a")), "pd.Series[bool]"), pd.Series, np.bool_)
check(assert_type(s.str.count("pp"), "pd.Series[int]"), pd.Series, np.integer)
check(assert_type(s.str.decode("utf-8"), pd.Series), pd.Series)
check(assert_type(s.str.encode("latin-1"), pd.Series), pd.Series)
Expand Down
Loading