|
24 | 24 | is_extension_array_dtype,
|
25 | 25 | is_integer,
|
26 | 26 | )
|
27 |
| -from pandas.core.dtypes.generic import ( |
28 |
| - ABCExtensionArray, |
29 |
| - ABCIndex, |
30 |
| - ABCIndexClass, |
31 |
| - ABCSeries, |
32 |
| -) |
| 27 | +from pandas.core.dtypes.generic import ABCExtensionArray, ABCIndexClass, ABCSeries |
33 | 28 | from pandas.core.dtypes.inference import iterable_not_string
|
34 | 29 | from pandas.core.dtypes.missing import isna, isnull, notnull # noqa
|
35 | 30 |
|
@@ -105,7 +100,7 @@ def is_bool_indexer(key: Any) -> bool:
|
105 | 100 | check_array_indexer : Check that `key` is a valid array to index,
|
106 | 101 | and convert to an ndarray.
|
107 | 102 | """
|
108 |
| - if isinstance(key, (ABCSeries, np.ndarray, ABCIndex)) or ( |
| 103 | + if isinstance(key, (ABCSeries, np.ndarray, ABCIndexClass)) or ( |
109 | 104 | is_array_like(key) and is_extension_array_dtype(key.dtype)
|
110 | 105 | ):
|
111 | 106 | if key.dtype == np.object_:
|
@@ -471,7 +466,9 @@ def convert_to_list_like(
|
471 | 466 | Convert list-like or scalar input to list-like. List, numpy and pandas array-like
|
472 | 467 | inputs are returned unmodified whereas others are converted to list.
|
473 | 468 | """
|
474 |
| - if isinstance(values, (list, np.ndarray, ABCIndex, ABCSeries, ABCExtensionArray)): |
| 469 | + if isinstance( |
| 470 | + values, (list, np.ndarray, ABCIndexClass, ABCSeries, ABCExtensionArray) |
| 471 | + ): |
475 | 472 | # np.ndarray resolving as Any gives a false positive
|
476 | 473 | return values # type: ignore[return-value]
|
477 | 474 | elif isinstance(values, abc.Iterable) and not isinstance(values, str):
|
|
0 commit comments