90
90
concat ,
91
91
isna ,
92
92
)
93
- from pandas .core .api import NumericIndex
94
93
from pandas .core .arrays import (
95
94
Categorical ,
96
95
DatetimeArray ,
@@ -2051,7 +2050,7 @@ def is_indexed(self) -> bool:
2051
2050
2052
2051
def convert (
2053
2052
self , values : np .ndarray , nan_rep , encoding : str , errors : str
2054
- ) -> tuple [np .ndarray , np .ndarray ] | tuple [DatetimeIndex , DatetimeIndex ]:
2053
+ ) -> tuple [np .ndarray , np .ndarray ] | tuple [Index , Index ]:
2055
2054
"""
2056
2055
Convert the data from this selection to the appropriate pandas type.
2057
2056
"""
@@ -2244,13 +2243,9 @@ class GenericIndexCol(IndexCol):
2244
2243
def is_indexed (self ) -> bool :
2245
2244
return False
2246
2245
2247
- # error: Return type "Tuple[NumericIndex, NumericIndex]" of "convert"
2248
- # incompatible with return type "Union[Tuple[ndarray[Any, Any],
2249
- # ndarray[Any, Any]], Tuple[DatetimeIndex, DatetimeIndex]]" in
2250
- # supertype "IndexCol"
2251
- def convert ( # type: ignore[override]
2246
+ def convert (
2252
2247
self , values : np .ndarray , nan_rep , encoding : str , errors : str
2253
- ) -> tuple [NumericIndex , NumericIndex ]:
2248
+ ) -> tuple [Index , Index ]:
2254
2249
"""
2255
2250
Convert the data from this selection to the appropriate pandas type.
2256
2251
@@ -2263,7 +2258,7 @@ def convert( # type: ignore[override]
2263
2258
"""
2264
2259
assert isinstance (values , np .ndarray ), type (values )
2265
2260
2266
- index = NumericIndex (np .arange (len (values )) , dtype = np .int64 )
2261
+ index = Index (np .arange (len (values ), dtype = np .int64 ) )
2267
2262
return index , index
2268
2263
2269
2264
def set_attr (self ) -> None :
@@ -4866,11 +4861,11 @@ def _convert_index(name: str, index: Index, encoding: str, errors: str) -> Index
4866
4861
atom = DataIndexableCol ._get_atom (converted )
4867
4862
4868
4863
if (
4869
- (isinstance (index , NumericIndex ) and is_integer_dtype (index ))
4864
+ (isinstance (index . dtype , np . dtype ) and is_integer_dtype (index ))
4870
4865
or needs_i8_conversion (index .dtype )
4871
4866
or is_bool_dtype (index .dtype )
4872
4867
):
4873
- # Includes NumericIndex , RangeIndex, DatetimeIndex, TimedeltaIndex, PeriodIndex,
4868
+ # Includes Index , RangeIndex, DatetimeIndex, TimedeltaIndex, PeriodIndex,
4874
4869
# in which case "kind" is "integer", "integer", "datetime64",
4875
4870
# "timedelta64", and "integer", respectively.
4876
4871
return IndexCol (
0 commit comments