Skip to content

Commit 38af8b5

Browse files
committed
DEPR: move NumericIndex._maybe_cast_slice_bound to Index
1 parent 27e65d4 commit 38af8b5

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

pandas/core/indexes/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6291,11 +6291,9 @@ def _maybe_cast_slice_bound(self, label, side: str_t):
62916291
"""
62926292

62936293
# We are a plain index here (sub-class override this method if they
6294-
# wish to have special treatment for floats/ints, e.g. NumericIndex and
6295-
# datetimelike Indexes
6296-
# Special case numeric EA Indexes, since they are not handled by NumericIndex
6294+
# wish to have special treatment for floats/ints, e.g. datetimelike Indexes
62976295

6298-
if is_extension_array_dtype(self.dtype) and is_numeric_dtype(self.dtype):
6296+
if is_numeric_dtype(self.dtype):
62996297
return self._maybe_cast_indexer(label)
63006298

63016299
# reject them, if index does not contain label

pandas/core/indexes/numeric.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@ def _ensure_dtype(cls, dtype: Dtype | None) -> np.dtype | None:
169169
def _should_fallback_to_positional(self) -> bool:
170170
return False
171171

172-
@doc(Index._maybe_cast_slice_bound)
173-
def _maybe_cast_slice_bound(self, label, side: str):
174-
# we will try to coerce to integers
175-
return self._maybe_cast_indexer(label)
176-
177172
# ----------------------------------------------------------------
178173

179174
@classmethod

0 commit comments

Comments
 (0)