Skip to content

Commit 17da7f7

Browse files
authored
CLN: remove unnecessary _comparables (#41638)
1 parent 7fe9217 commit 17da7f7

File tree

5 files changed

+3
-14
lines changed

5 files changed

+3
-14
lines changed

pandas/core/indexes/datetimelike.py

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class DatetimeIndexOpsMixin(NDArrayBackedExtensionIndex):
8282
Common ops mixin to support a unified interface datetimelike Index.
8383
"""
8484

85+
_is_numeric_dtype = False
8586
_can_hold_strings = False
8687
_data: DatetimeArray | TimedeltaArray | PeriodArray
8788
freq: BaseOffset | None
@@ -608,6 +609,8 @@ class DatetimeTimedeltaMixin(DatetimeIndexOpsMixin):
608609
"""
609610

610611
_data: DatetimeArray | TimedeltaArray
612+
_comparables = ["name", "freq"]
613+
_attributes = ["name", "freq"]
611614

612615
# Compat for frequency inference, see GH#23789
613616
_is_monotonic_increasing = Index.is_monotonic_increasing

pandas/core/indexes/datetimes.py

-5
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,6 @@ class DatetimeIndex(DatetimeTimedeltaMixin):
256256
_engine_type = libindex.DatetimeEngine
257257
_supports_partial_string_indexing = True
258258

259-
_comparables = ["name", "freqstr"]
260-
_attributes = ["name", "freq"]
261-
262-
_is_numeric_dtype = False
263-
264259
_data: DatetimeArray
265260
inferred_freq: str | None
266261
tz: tzinfo | None

pandas/core/indexes/interval.py

-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ def func(self, other, sort=None):
252252
@inherit_names(["is_non_overlapping_monotonic", "closed"], IntervalArray, cache=True)
253253
class IntervalIndex(ExtensionIndex):
254254
_typ = "intervalindex"
255-
_comparables = ["name"]
256-
_attributes = ["name"]
257255

258256
# annotate properties pinned via inherit_names
259257
closed: str

pandas/core/indexes/period.py

-3
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ class PeriodIndex(DatetimeIndexOpsMixin):
158158
_typ = "periodindex"
159159
_attributes = ["name"]
160160

161-
# define my properties & methods for delegation
162-
_is_numeric_dtype = False
163-
164161
_data: PeriodArray
165162
freq: BaseOffset
166163

pandas/core/indexes/timedeltas.py

-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ class TimedeltaIndex(DatetimeTimedeltaMixin):
112112
_data_cls = TimedeltaArray
113113
_engine_type = libindex.TimedeltaEngine
114114

115-
_comparables = ["name", "freq"]
116-
_attributes = ["name", "freq"]
117-
_is_numeric_dtype = False
118-
119115
_data: TimedeltaArray
120116

121117
# -------------------------------------------------------------------

0 commit comments

Comments
 (0)