Skip to content

CLN: Update docstring decorator from Appender to doc #32828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/arrays/numpy_.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pandas._libs import lib
from pandas.compat.numpy import function as nv
from pandas.util._decorators import Appender
from pandas.util._decorators import doc
from pandas.util._validators import validate_fillna_kwargs

from pandas.core.dtypes.dtypes import ExtensionDtype
Expand Down Expand Up @@ -449,7 +449,7 @@ def to_numpy(

return result

@Appender(ExtensionArray.searchsorted.__doc__)
@doc(ExtensionArray.searchsorted)
def searchsorted(self, value, side="left", sorter=None):
return searchsorted(self.to_numpy(), value, side=side, sorter=sorter)

Expand Down
10 changes: 5 additions & 5 deletions pandas/core/indexes/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from pandas.compat.numpy import function as nv
from pandas.errors import AbstractMethodError
from pandas.util._decorators import Appender, cache_readonly
from pandas.util._decorators import cache_readonly, doc

from pandas.core.dtypes.common import (
ensure_platform_int,
Expand Down Expand Up @@ -231,7 +231,7 @@ def __array__(self, dtype=None) -> np.ndarray:
def _get_engine_target(self) -> np.ndarray:
return self._data._values_for_argsort()

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

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

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

@Appender(Index.astype.__doc__)
@doc(Index.astype)
def astype(self, dtype, copy=True):
if is_dtype_equal(self.dtype, dtype) and copy is False:
# Ensure that self.astype(self.dtype) is self
Expand Down