@@ -250,12 +250,11 @@ def asi8(self) -> np.ndarray:
250250 return self .values .view (self ._default_dtype )
251251
252252 @Appender (Index ._convert_scalar_indexer .__doc__ )
253- def _convert_scalar_indexer (self , key , kind = None ):
254- assert kind in ["loc" , "getitem" , "iloc" , None ]
253+ def _convert_scalar_indexer (self , key , kind : str ):
254+ assert kind in ["loc" , "getitem" ]
255255
256- # don't coerce ilocs to integers
257- if kind != "iloc" :
258- key = self ._maybe_cast_indexer (key )
256+ # never iloc, which we don't coerce to integers
257+ key = self ._maybe_cast_indexer (key )
259258 return super ()._convert_scalar_indexer (key , kind = kind )
260259
261260
@@ -388,12 +387,9 @@ def _should_fallback_to_positional(self):
388387 return False
389388
390389 @Appender (Index ._convert_scalar_indexer .__doc__ )
391- def _convert_scalar_indexer (self , key , kind = None ):
392- assert kind in ["loc" , "getitem" , "iloc" , None ]
393-
394- if kind == "iloc" :
395- self ._validate_indexer ("positional" , key , "iloc" )
396-
390+ def _convert_scalar_indexer (self , key , kind : str ):
391+ assert kind in ["loc" , "getitem" ]
392+ # no-op for non-iloc
397393 return key
398394
399395 @Appender (Index ._convert_slice_indexer .__doc__ )
0 commit comments