Skip to content

Commit 470ccf4

Browse files
GH1139 PR Feedback
1 parent 17a1049 commit 470ccf4

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

pandas-stubs/core/series.pyi

+2-13
Original file line numberDiff line numberDiff line change
@@ -1043,18 +1043,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
10431043
@overload
10441044
def rename(
10451045
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
1055-
def rename(
1056-
self,
1057-
index: Hashable,
1046+
index: Hashable | None,
10581047
*,
10591048
axis: Axis | None = ...,
10601049
copy: bool = ...,
@@ -1065,7 +1054,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
10651054
@overload
10661055
def rename(
10671056
self,
1068-
index: Renamer | None = ...,
1057+
index: Renamer = ...,
10691058
*,
10701059
axis: Axis | None = ...,
10711060
copy: bool = ...,

tests/test_series.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,11 @@ def add1(x: int) -> int:
12381238
type(None),
12391239
)
12401240
check(
1241-
assert_type(pd.Series([1, 2, 3]).rename(index=None, inplace=True), None),
1242-
type(None),
1241+
assert_type(
1242+
pd.Series([1, 2, 3]).rename(index=None, inplace=True), "pd.Series[int]"
1243+
),
1244+
pd.Series,
1245+
np.integer,
12431246
)
12441247
# TODO this should not raise an error, the lambda is matched with Hashable
12451248
# check(

0 commit comments

Comments
 (0)