API/BUG: raise only KeyError failed on geitem/loc lookups by jbrockmendel · Pull Request #31867 · pandas-dev/pandas (original) (raw)
ok I think this is reasonable, e.g. this highlites the difference between indexing a list for example with a non-integer (raises TypeError) and a dict with anything (raises KeyError). consistency is good.
As far as user impact; this is a change, but likely does not affect very many downstream users (who are likely catching both TypeError and KeyError).
would be ok with simply changing this (to raise KeyError), unless other objections.