Skip to content

Issue/26506 Provides correct desciption in docstring that get_indexer methods are not yet supported #26519

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 18 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from 16 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
3 changes: 2 additions & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

_index_doc_kwargs = dict(klass='Index', inplace='',
target_klass='Index',
raises_section='',
unique='Index', duplicated='np.ndarray')
_index_shared_docs = dict()

Expand Down Expand Up @@ -2787,7 +2788,7 @@ def get_loc(self, key, method=None, tolerance=None):
Integers from 0 to n - 1 indicating that the index at these
positions matches the corresponding target values. Missing values
in the target are marked by -1.

%(raises_section)s
Examples
--------
>>> index = pd.Index(['c', 'a', 'b'])
Expand Down
12 changes: 10 additions & 2 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from pandas._libs import Timedelta, Timestamp
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas.util._decorators import Appender, cache_readonly
from pandas.util._decorators import Appender, Substitution, cache_readonly
from pandas.util._exceptions import rewrite_exception

from pandas.core.dtypes.cast import (
Expand Down Expand Up @@ -805,7 +805,15 @@ def get_value(self, series, key):
loc = self.get_loc(key)
return series.iloc[loc]

@Appender(_index_shared_docs['get_indexer'] % _index_doc_kwargs)
@Substitution(**dict(_index_doc_kwargs,
**{'raises_section': textwrap.dedent("""
Raises
------
NotImplementedError
If any method other than than the default method is specified as
these are not yet implemented.
""")}))
@Appender(_index_shared_docs['get_indexer'])
def get_indexer(self, target, method=None, limit=None, tolerance=None):

self._check_method(method)
Expand Down