Skip to content

Commit e46842a

Browse files
committed
Updates:
- combine two str.split overloads and keep only _TS and _TS2; - fix test_indexes.py test for test_str_split().
1 parent 577d375 commit e46842a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

pandas-stubs/core/strings.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,9 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM, _TS2]):
6969
) -> _TS: ...
7070
@overload
7171
def split(
72-
self, pat: str = ..., *, n: int = ..., expand: Literal[False], regex: bool = ...
72+
self, pat: str = ..., *, n: int = ..., expand: Literal[False] = ..., regex: bool = ...
7373
) -> _TS2: ...
7474
@overload
75-
def split(
76-
self, pat: str = ..., *, n: int = ..., expand: bool = ..., regex: bool = ...
77-
) -> T: ...
78-
@overload
7975
def rsplit(self, pat: str = ..., *, n: int = ..., expand: Literal[True]) -> _TS: ...
8076
@overload
8177
def rsplit(self, pat: str = ..., *, n: int = ..., expand: bool = ...) -> T: ...

tests/test_indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_difference_none() -> None:
111111
def test_str_split() -> None:
112112
# GH 194
113113
ind = pd.Index(["a-b", "c-d"])
114-
check(assert_type(ind.str.split("-"), "pd.Index[str]"), pd.Index)
114+
check(assert_type(ind.str.split("-"), "pd.Index[list[str]]"), pd.Index)
115115
check(assert_type(ind.str.split("-", expand=True), pd.MultiIndex), pd.MultiIndex)
116116
check(
117117
assert_type(ind.str.split("-", expand=False), "pd.Index[list[str]]"), pd.Index, list

0 commit comments

Comments
 (0)