@@ -250,12 +250,11 @@ def asi8(self) -> np.ndarray:
250
250
return self .values .view (self ._default_dtype )
251
251
252
252
@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" ]
255
255
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 )
259
258
return super ()._convert_scalar_indexer (key , kind = kind )
260
259
261
260
@@ -388,12 +387,9 @@ def _should_fallback_to_positional(self):
388
387
return False
389
388
390
389
@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
397
393
return key
398
394
399
395
@Appender (Index ._convert_slice_indexer .__doc__ )
0 commit comments