Skip to content

Commit 120e2bc

Browse files
get_loc should raise KeyError if the supplied key has the wrong type
1 parent 6ed1080 commit 120e2bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/interval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def get_value(self, series, key):
809809

810810
try:
811811
loc = self.get_loc(key)
812-
except TypeError:
812+
except KeyError:
813813
# we didn't find exact intervals or are non-unique
814814
msg = "unable to slice with this key: {key}".format(key=key)
815815
raise ValueError(msg)

0 commit comments

Comments
 (0)