Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-vlados committed Dec 18, 2024
1 parent e46842a commit 7ba4a45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pandas-stubs/core/strings.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM, _TS2]):
) -> _TS: ...
@overload
def split(
self, pat: str = ..., *, n: int = ..., expand: Literal[False] = ..., regex: bool = ...
self,
pat: str = ...,
*,
n: int = ...,
expand: Literal[False] = ...,
regex: bool = ...,
) -> _TS2: ...
@overload
def rsplit(self, pat: str = ..., *, n: int = ..., expand: Literal[True]) -> _TS: ...
Expand Down
4 changes: 3 additions & 1 deletion tests/test_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def test_str_split() -> None:
check(assert_type(ind.str.split("-"), "pd.Index[list[str]]"), pd.Index)
check(assert_type(ind.str.split("-", expand=True), pd.MultiIndex), pd.MultiIndex)
check(
assert_type(ind.str.split("-", expand=False), "pd.Index[list[str]]"), pd.Index, list
assert_type(ind.str.split("-", expand=False), "pd.Index[list[str]]"),
pd.Index,
list,
)


Expand Down
4 changes: 3 additions & 1 deletion tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,9 @@ def test_string_accessors():
# GH 194
check(assert_type(s.str.split("a", expand=True), pd.DataFrame), pd.DataFrame)
check(
assert_type(s.str.split("a", expand=False), "pd.Series[list[str]]"), pd.Series, list
assert_type(s.str.split("a", expand=False), "pd.Series[list[str]]"),
pd.Series,
list,
)
check(assert_type(s.str.startswith("a"), "pd.Series[bool]"), pd.Series, np.bool_)
check(
Expand Down

0 comments on commit 7ba4a45

Please sign in to comment.