Skip to content

Commit 59df3e0

Browse files
timgates42jreback
authored andcommitted
Issue/26506 Provides correct desciption in docstring that get_indexer methods are not yet supported (#26519)
1 parent 5488636 commit 59df3e0

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pandas/core/indexes/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
_index_doc_kwargs = dict(klass='Index', inplace='',
5454
target_klass='Index',
55+
raises_section='',
5556
unique='Index', duplicated='np.ndarray')
5657
_index_shared_docs = dict()
5758

@@ -2787,7 +2788,7 @@ def get_loc(self, key, method=None, tolerance=None):
27872788
Integers from 0 to n - 1 indicating that the index at these
27882789
positions matches the corresponding target values. Missing values
27892790
in the target are marked by -1.
2790-
2791+
%(raises_section)s
27912792
Examples
27922793
--------
27932794
>>> index = pd.Index(['c', 'a', 'b'])

pandas/core/indexes/interval.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from pandas._libs import Timedelta, Timestamp
1010
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
11-
from pandas.util._decorators import Appender, cache_readonly
11+
from pandas.util._decorators import Appender, Substitution, cache_readonly
1212
from pandas.util._exceptions import rewrite_exception
1313

1414
from pandas.core.dtypes.cast import (
@@ -822,7 +822,15 @@ def get_value(self, series, key):
822822
loc = self.get_loc(key)
823823
return series.iloc[loc]
824824

825-
@Appender(_index_shared_docs['get_indexer'] % _index_doc_kwargs)
825+
@Substitution(**dict(_index_doc_kwargs,
826+
**{'raises_section': textwrap.dedent("""
827+
Raises
828+
------
829+
NotImplementedError
830+
If any method argument other than the default of
831+
None is specified as these are not yet implemented.
832+
""")}))
833+
@Appender(_index_shared_docs['get_indexer'])
826834
def get_indexer(self, target, method=None, limit=None, tolerance=None):
827835

828836
self._check_method(method)

0 commit comments

Comments
 (0)