4
4
from typing import TYPE_CHECKING , Type , cast
5
5
6
6
if TYPE_CHECKING :
7
- from pandas import DataFrame , Series
7
+ from pandas import (
8
+ CategoricalIndex ,
9
+ DataFrame ,
10
+ DatetimeIndex ,
11
+ Float64Index ,
12
+ Int64Index ,
13
+ IntervalIndex ,
14
+ MultiIndex ,
15
+ PeriodIndex ,
16
+ RangeIndex ,
17
+ Series ,
18
+ TimedeltaIndex ,
19
+ UInt64Index ,
20
+ )
8
21
from pandas .core .generic import NDFrame
9
22
10
23
@@ -23,23 +36,45 @@ def _check(cls, inst) -> bool:
23
36
return meta (name , (), dct )
24
37
25
38
26
- ABCInt64Index = create_pandas_abc_type ("ABCInt64Index" , "_typ" , ("int64index" ,))
27
- ABCUInt64Index = create_pandas_abc_type ("ABCUInt64Index" , "_typ" , ("uint64index" ,))
28
- ABCRangeIndex = create_pandas_abc_type ("ABCRangeIndex" , "_typ" , ("rangeindex" ,))
29
- ABCFloat64Index = create_pandas_abc_type ("ABCFloat64Index" , "_typ" , ("float64index" ,))
30
- ABCMultiIndex = create_pandas_abc_type ("ABCMultiIndex" , "_typ" , ("multiindex" ,))
31
- ABCDatetimeIndex = create_pandas_abc_type (
32
- "ABCDatetimeIndex" , "_typ" , ("datetimeindex" ,)
33
- )
34
- ABCTimedeltaIndex = create_pandas_abc_type (
35
- "ABCTimedeltaIndex" , "_typ" , ("timedeltaindex" ,)
36
- )
37
- ABCPeriodIndex = create_pandas_abc_type ("ABCPeriodIndex" , "_typ" , ("periodindex" ,))
38
- ABCCategoricalIndex = create_pandas_abc_type (
39
- "ABCCategoricalIndex" , "_typ" , ("categoricalindex" ,)
40
- )
41
- ABCIntervalIndex = create_pandas_abc_type (
42
- "ABCIntervalIndex" , "_typ" , ("intervalindex" ,)
39
+ ABCInt64Index = cast (
40
+ "Type[Int64Index]" ,
41
+ create_pandas_abc_type ("ABCInt64Index" , "_typ" , ("int64index" ,)),
42
+ )
43
+ ABCUInt64Index = cast (
44
+ "Type[UInt64Index]" ,
45
+ create_pandas_abc_type ("ABCUInt64Index" , "_typ" , ("uint64index" ,)),
46
+ )
47
+ ABCRangeIndex = cast (
48
+ "Type[RangeIndex]" ,
49
+ create_pandas_abc_type ("ABCRangeIndex" , "_typ" , ("rangeindex" ,)),
50
+ )
51
+ ABCFloat64Index = cast (
52
+ "Type[Float64Index]" ,
53
+ create_pandas_abc_type ("ABCFloat64Index" , "_typ" , ("float64index" ,)),
54
+ )
55
+ ABCMultiIndex = cast (
56
+ "Type[MultiIndex]" ,
57
+ create_pandas_abc_type ("ABCMultiIndex" , "_typ" , ("multiindex" ,)),
58
+ )
59
+ ABCDatetimeIndex = cast (
60
+ "Type[DatetimeIndex]" ,
61
+ create_pandas_abc_type ("ABCDatetimeIndex" , "_typ" , ("datetimeindex" ,)),
62
+ )
63
+ ABCTimedeltaIndex = cast (
64
+ "Type[TimedeltaIndex]" ,
65
+ create_pandas_abc_type ("ABCTimedeltaIndex" , "_typ" , ("timedeltaindex" ,)),
66
+ )
67
+ ABCPeriodIndex = cast (
68
+ "Type[PeriodIndex]" ,
69
+ create_pandas_abc_type ("ABCPeriodIndex" , "_typ" , ("periodindex" ,)),
70
+ )
71
+ ABCCategoricalIndex = cast (
72
+ "Type[CategoricalIndex]" ,
73
+ create_pandas_abc_type ("ABCCategoricalIndex" , "_typ" , ("categoricalindex" ,)),
74
+ )
75
+ ABCIntervalIndex = cast (
76
+ "Type[IntervalIndex]" ,
77
+ create_pandas_abc_type ("ABCIntervalIndex" , "_typ" , ("intervalindex" ,)),
43
78
)
44
79
ABCIndexClass = create_pandas_abc_type (
45
80
"ABCIndexClass" ,
0 commit comments