Skip to content

Commit 2983464

Browse files
TYP: Add overload for ser.rename_axis (#55412)
* Add overload for rename_axis * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e4635ac commit 2983464

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

pandas/core/series.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5004,8 +5004,44 @@ def reindex( # type: ignore[override]
50045004
tolerance=tolerance,
50055005
)
50065006

5007+
@overload # type: ignore[override]
5008+
def rename_axis(
5009+
self,
5010+
mapper: IndexLabel | lib.NoDefault = ...,
5011+
*,
5012+
index=...,
5013+
axis: Axis = ...,
5014+
copy: bool = ...,
5015+
inplace: Literal[True],
5016+
) -> None:
5017+
...
5018+
5019+
@overload
5020+
def rename_axis(
5021+
self,
5022+
mapper: IndexLabel | lib.NoDefault = ...,
5023+
*,
5024+
index=...,
5025+
axis: Axis = ...,
5026+
copy: bool = ...,
5027+
inplace: Literal[False] = ...,
5028+
) -> Self:
5029+
...
5030+
5031+
@overload
5032+
def rename_axis(
5033+
self,
5034+
mapper: IndexLabel | lib.NoDefault = ...,
5035+
*,
5036+
index=...,
5037+
axis: Axis = ...,
5038+
copy: bool = ...,
5039+
inplace: bool = ...,
5040+
) -> Self | None:
5041+
...
5042+
50075043
@doc(NDFrame.rename_axis)
5008-
def rename_axis( # type: ignore[override]
5044+
def rename_axis(
50095045
self,
50105046
mapper: IndexLabel | lib.NoDefault = lib.no_default,
50115047
*,

0 commit comments

Comments
 (0)