Skip to content

Commit 346812b

Browse files
raisadzSeeminSyed
authored andcommitted
CLN: Update docstring decorator from Appender to doc (pandas-dev#32828)
1 parent 20b532f commit 346812b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pandas/core/arrays/numpy_.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pandas._libs import lib
88
from pandas.compat.numpy import function as nv
9-
from pandas.util._decorators import Appender
9+
from pandas.util._decorators import doc
1010
from pandas.util._validators import validate_fillna_kwargs
1111

1212
from pandas.core.dtypes.dtypes import ExtensionDtype
@@ -449,7 +449,7 @@ def to_numpy(
449449

450450
return result
451451

452-
@Appender(ExtensionArray.searchsorted.__doc__)
452+
@doc(ExtensionArray.searchsorted)
453453
def searchsorted(self, value, side="left", sorter=None):
454454
return searchsorted(self.to_numpy(), value, side=side, sorter=sorter)
455455

pandas/core/indexes/extension.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from pandas.compat.numpy import function as nv
99
from pandas.errors import AbstractMethodError
10-
from pandas.util._decorators import Appender, cache_readonly
10+
from pandas.util._decorators import cache_readonly, doc
1111

1212
from pandas.core.dtypes.common import (
1313
ensure_platform_int,
@@ -231,7 +231,7 @@ def __array__(self, dtype=None) -> np.ndarray:
231231
def _get_engine_target(self) -> np.ndarray:
232232
return self._data._values_for_argsort()
233233

234-
@Appender(Index.dropna.__doc__)
234+
@doc(Index.dropna)
235235
def dropna(self, how="any"):
236236
if how not in ("any", "all"):
237237
raise ValueError(f"invalid how option: {how}")
@@ -253,7 +253,7 @@ def _concat_same_dtype(self, to_concat, name):
253253
arr = type(self._data)._concat_same_type(to_concat)
254254
return type(self)._simple_new(arr, name=name)
255255

256-
@Appender(Index.take.__doc__)
256+
@doc(Index.take)
257257
def take(self, indices, axis=0, allow_fill=True, fill_value=None, **kwargs):
258258
nv.validate_take(tuple(), kwargs)
259259
indices = ensure_platform_int(indices)
@@ -283,7 +283,7 @@ def _get_unique_index(self, dropna=False):
283283
result = result[~result.isna()]
284284
return self._shallow_copy(result)
285285

286-
@Appender(Index.map.__doc__)
286+
@doc(Index.map)
287287
def map(self, mapper, na_action=None):
288288
# Try to run function on index first, and then on elements of index
289289
# Especially important for group-by functionality
@@ -300,7 +300,7 @@ def map(self, mapper, na_action=None):
300300
except Exception:
301301
return self.astype(object).map(mapper)
302302

303-
@Appender(Index.astype.__doc__)
303+
@doc(Index.astype)
304304
def astype(self, dtype, copy=True):
305305
if is_dtype_equal(self.dtype, dtype) and copy is False:
306306
# Ensure that self.astype(self.dtype) is self

0 commit comments

Comments
 (0)