Skip to content

Commit 17a1049

Browse files
GH1139 PR Feedback
1 parent 1b6e4c7 commit 17a1049

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

pandas-stubs/core/series.pyi

+11
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,17 @@ class Series(IndexOpsMixin[S1], NDFrame):
10411041
broadcast_axis: AxisIndex | None = ...,
10421042
) -> tuple[Series, Series]: ...
10431043
@overload
1044+
def rename(
1045+
self,
1046+
index: None = ...,
1047+
*,
1048+
axis: Axis | None = ...,
1049+
copy: bool = ...,
1050+
inplace: Literal[True],
1051+
level: Level | None = ...,
1052+
errors: IgnoreRaise = ...,
1053+
) -> None: ...
1054+
@overload
10441055
def rename(
10451056
self,
10461057
index: Hashable,

tests/test_series.py

+4
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,10 @@ def add1(x: int) -> int:
12371237
assert_type(pd.Series([1, 2, 3]).rename({1: 4, 2: 5}, inplace=True), None),
12381238
type(None),
12391239
)
1240+
check(
1241+
assert_type(pd.Series([1, 2, 3]).rename(index=None, inplace=True), None),
1242+
type(None),
1243+
)
12401244
# TODO this should not raise an error, the lambda is matched with Hashable
12411245
# check(
12421246
# assert_type(pd.Series([1, 2, 3]).rename(lambda x: x**2, inplace=True), None), type(None)

0 commit comments

Comments
 (0)