Skip to content

Commit 474adf1

Browse files
committed
BUG: Fixes GH14554
Indexing errors nolonger forced in to KeyError
1 parent f26b049 commit 474adf1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/indexing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ def _multi_take(self, tup):
849849
for t, a in zip(tup, o._AXIS_ORDERS)])
850850
return o.reindex(**d)
851851
except:
852-
raise self._exception
852+
raise
853853

854854
def _convert_for_reindex(self, key, axis=0):
855855
labels = self.obj._get_axis(axis)
@@ -1320,8 +1320,8 @@ def _getbool_axis(self, key, axis=0):
13201320
inds, = key.nonzero()
13211321
try:
13221322
return self.obj.take(inds, axis=axis, convert=False)
1323-
except Exception as detail:
1324-
raise self._exception(detail)
1323+
except:
1324+
raise
13251325

13261326
def _get_slice_axis(self, slice_obj, axis=0):
13271327
""" this is pretty simple as we just have to deal with labels """

pandas/tests/indexing/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ def test_loc_getitem_bool(self):
12161216
self.check_result('bool', 'loc', b, 'ix', b,
12171217
typs=['ints', 'labels', 'mixed', 'ts', 'floats'])
12181218
self.check_result('bool', 'loc', b, 'ix', b, typs=['empty'],
1219-
fails=KeyError)
1219+
fails=IndexError)
12201220

12211221
def test_loc_getitem_int_slice(self):
12221222

0 commit comments

Comments
 (0)