@@ -101,7 +101,6 @@ class IndexingError(Exception):
101
101
102
102
class _NDFrameIndexer (_NDFrameIndexerBase ):
103
103
_valid_types = None # type: str
104
- _exception = Exception
105
104
axis = None
106
105
107
106
def __call__ (self , axis = None ):
@@ -881,14 +880,6 @@ def _handle_lowerdim_multi_index_axis0(self, tup: Tuple):
881
880
# else IndexingError will be raised
882
881
if len (tup ) <= self .obj .index .nlevels and len (tup ) > self .ndim :
883
882
raise ek
884
- except Exception as e1 :
885
- if isinstance (tup [0 ], (slice , Index )):
886
- raise IndexingError ("Handle elsewhere" )
887
-
888
- # raise the error if we are not sorted
889
- ax0 = self .obj ._get_axis (0 )
890
- if not ax0 .is_lexsorted_for_tuple (tup ):
891
- raise e1
892
883
893
884
return None
894
885
@@ -1385,8 +1376,6 @@ def _convert_for_reindex(self, key, axis: int):
1385
1376
1386
1377
1387
1378
class _LocationIndexer (_NDFrameIndexer ):
1388
- _exception = Exception
1389
-
1390
1379
def __getitem__ (self , key ):
1391
1380
if type (key ) is tuple :
1392
1381
key = tuple (com .apply_if_callable (x , self .obj ) for x in key )
@@ -1417,10 +1406,7 @@ def _getbool_axis(self, key, axis: int):
1417
1406
labels = self .obj ._get_axis (axis )
1418
1407
key = check_bool_indexer (labels , key )
1419
1408
inds = key .nonzero ()[0 ]
1420
- try :
1421
- return self .obj .take (inds , axis = axis )
1422
- except Exception as detail :
1423
- raise self ._exception (detail )
1409
+ return self .obj .take (inds , axis = axis )
1424
1410
1425
1411
def _get_slice_axis (self , slice_obj : slice , axis : int ):
1426
1412
""" this is pretty simple as we just have to deal with labels """
@@ -1685,7 +1671,6 @@ class _LocIndexer(_LocationIndexer):
1685
1671
"endpoints included! Can be slices of integers if the "
1686
1672
"index is integers), listlike of labels, boolean"
1687
1673
)
1688
- _exception = KeyError
1689
1674
1690
1675
@Appender (_NDFrameIndexer ._validate_key .__doc__ )
1691
1676
def _validate_key (self , key , axis : int ):
@@ -1970,7 +1955,6 @@ class _iLocIndexer(_LocationIndexer):
1970
1955
"integer, integer slice (START point is INCLUDED, END "
1971
1956
"point is EXCLUDED), listlike of integers, boolean array"
1972
1957
)
1973
- _exception = IndexError
1974
1958
_get_slice_axis = _NDFrameIndexer ._get_slice_axis
1975
1959
1976
1960
def _validate_key (self , key , axis : int ):
0 commit comments