Skip to content

Commit 43f1161

Browse files
jbrockmendeljreback
authored andcommitted
Remove unused Index attributes (#19397)
1 parent eec7f57 commit 43f1161

File tree

8 files changed

+3
-16
lines changed

8 files changed

+3
-16
lines changed

pandas/core/indexes/base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,10 @@ class Index(IndexOpsMixin, PandasObject):
141141
_join_precedence = 1
142142

143143
# Cython methods
144-
_arrmap = libalgos.arrmap_object
145144
_left_indexer_unique = libjoin.left_join_indexer_unique_object
146145
_left_indexer = libjoin.left_join_indexer_object
147146
_inner_indexer = libjoin.inner_join_indexer_object
148147
_outer_indexer = libjoin.outer_join_indexer_object
149-
_box_scalars = False
150148

151149
_typ = 'index'
152150
_data = None
@@ -155,9 +153,6 @@ class Index(IndexOpsMixin, PandasObject):
155153
asi8 = None
156154
_comparables = ['name']
157155
_attributes = ['name']
158-
_allow_index_ops = True
159-
_allow_datetime_index_ops = False
160-
_allow_period_index_ops = False
161156
_is_numeric_dtype = False
162157
_can_hold_na = True
163158

pandas/core/indexes/datetimes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def _join_i8_wrapper(joinf, **kwargs):
282282
_left_indexer = _join_i8_wrapper(libjoin.left_join_indexer_int64)
283283
_left_indexer_unique = _join_i8_wrapper(
284284
libjoin.left_join_indexer_unique_int64, with_indexers=False)
285-
_arrmap = None
286285

287286
@classmethod
288287
def _add_comparison_methods(cls):

pandas/core/indexes/interval.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ class IntervalIndex(IntervalMixin, Index):
207207
_typ = 'intervalindex'
208208
_comparables = ['name']
209209
_attributes = ['name', 'closed']
210-
_allow_index_ops = True
211210

212211
# we would like our indexing holder to defer to us
213212
_defer_to_indexing = True

pandas/core/indexes/numeric.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
from pandas._libs import (index as libindex,
3-
algos as libalgos, join as libjoin)
3+
join as libjoin)
44
from pandas.core.dtypes.common import (
55
is_dtype_equal,
66
pandas_dtype,
@@ -158,7 +158,6 @@ class Int64Index(NumericIndex):
158158
__doc__ = _num_index_shared_docs['class_descr'] % _int64_descr_args
159159

160160
_typ = 'int64index'
161-
_arrmap = libalgos.arrmap_int64
162161
_left_indexer_unique = libjoin.left_join_indexer_unique_int64
163162
_left_indexer = libjoin.left_join_indexer_int64
164163
_inner_indexer = libjoin.inner_join_indexer_int64
@@ -217,7 +216,6 @@ class UInt64Index(NumericIndex):
217216
__doc__ = _num_index_shared_docs['class_descr'] % _uint64_descr_args
218217

219218
_typ = 'uint64index'
220-
_arrmap = libalgos.arrmap_uint64
221219
_left_indexer_unique = libjoin.left_join_indexer_unique_uint64
222220
_left_indexer = libjoin.left_join_indexer_uint64
223221
_inner_indexer = libjoin.inner_join_indexer_uint64
@@ -296,7 +294,6 @@ class Float64Index(NumericIndex):
296294

297295
_typ = 'float64index'
298296
_engine_type = libindex.Float64Engine
299-
_arrmap = libalgos.arrmap_float64
300297
_left_indexer_unique = libjoin.left_join_indexer_unique_float64
301298
_left_indexer = libjoin.left_join_indexer_float64
302299
_inner_indexer = libjoin.inner_join_indexer_float64

pandas/core/indexes/period.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ class PeriodIndex(DatelikeOps, DatetimeIndexOpsMixin, Int64Index):
204204
DatetimeIndex : Index with datetime64 data
205205
TimedeltaIndex : Index of timedelta64 data
206206
"""
207-
_box_scalars = True
208207
_typ = 'periodindex'
209208
_attributes = ['name', 'freq']
210209

pandas/core/indexes/timedeltas.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ def _join_i8_wrapper(joinf, **kwargs):
170170
_left_indexer = _join_i8_wrapper(libjoin.left_join_indexer_int64)
171171
_left_indexer_unique = _join_i8_wrapper(
172172
libjoin.left_join_indexer_unique_int64, with_indexers=False)
173-
_arrmap = None
174173

175174
# define my properties & methods for delegation
176175
_other_ops = []

pandas/core/series.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
144144
_deprecations = generic.NDFrame._deprecations | frozenset(
145145
['asobject', 'sortlevel', 'reshape', 'get_value', 'set_value',
146146
'from_csv', 'valid'])
147-
_allow_index_ops = True
148147

149148
def __init__(self, data=None, index=None, dtype=None, name=None,
150149
copy=False, fastpath=False):

pandas/tests/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ class TestIndexOps(Ops):
265265

266266
def setup_method(self, method):
267267
super(TestIndexOps, self).setup_method(method)
268-
self.is_valid_objs = [o for o in self.objs if o._allow_index_ops]
269-
self.not_valid_objs = [o for o in self.objs if not o._allow_index_ops]
268+
self.is_valid_objs = self.objs
269+
self.not_valid_objs = []
270270

271271
def test_none_comparison(self):
272272

0 commit comments

Comments
 (0)