Skip to content

Commit c0d235f

Browse files
authored
DOC: fix PR02 errors in docstrings of Index subclasses (#57261)
* DOC: fix PR02 errors in docstrings of Index subclasses * mypy
1 parent 46fd711 commit c0d235f

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

ci/code_checks.sh

-20
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7171

7272
MSG='Partially validate docstrings (PR02)' ; echo $MSG
7373
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR02 --ignore_functions \
74-
pandas.CategoricalIndex.rename_categories\
75-
pandas.CategoricalIndex.reorder_categories\
76-
pandas.CategoricalIndex.add_categories\
77-
pandas.CategoricalIndex.remove_categories\
78-
pandas.CategoricalIndex.set_categories\
79-
pandas.IntervalIndex.set_closed\
80-
pandas.IntervalIndex.contains\
81-
pandas.IntervalIndex.overlaps\
82-
pandas.IntervalIndex.to_tuples\
83-
pandas.DatetimeIndex.round\
84-
pandas.DatetimeIndex.floor\
85-
pandas.DatetimeIndex.ceil\
86-
pandas.DatetimeIndex.month_name\
87-
pandas.DatetimeIndex.day_name\
88-
pandas.DatetimeIndex.to_period\
89-
pandas.DatetimeIndex.std\
90-
pandas.TimedeltaIndex.round\
91-
pandas.TimedeltaIndex.floor\
92-
pandas.TimedeltaIndex.ceil\
93-
pandas.PeriodIndex.strftime\
9474
pandas.Series.dt.to_period\
9575
pandas.Series.dt.tz_localize\
9676
pandas.Series.dt.tz_convert\

pandas/core/indexes/extension.py

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
from __future__ import annotations
55

6+
from inspect import signature
67
from typing import (
78
TYPE_CHECKING,
89
Callable,
@@ -104,6 +105,7 @@ def method(self, *args, **kwargs): # type: ignore[misc]
104105
# error: "property" has no attribute "__name__"
105106
method.__name__ = name # type: ignore[attr-defined]
106107
method.__doc__ = attr.__doc__
108+
method.__signature__ = signature(attr) # type: ignore[attr-defined]
107109
return method
108110

109111

0 commit comments

Comments
 (0)