14
14
Sequence ,
15
15
Tuple ,
16
16
Union ,
17
- TYPE_CHECKING ,
18
17
)
19
18
20
19
if TYPE_CHECKING :
21
- from .dataframe_object import DataFrame
20
+ from .dataframe_object import DataFrame as DataFrameType
21
+ from .column_object import Column as ColumnType
22
22
23
23
if TYPE_CHECKING :
24
24
from .dtypes import (
48
48
class Namespace (Protocol ):
49
49
__dataframe_api_version__ : str
50
50
51
- class DataFrame :
51
+ @staticmethod
52
+ def DataFrame () -> DataFrameType :
52
53
...
53
54
54
- class Column :
55
+ @staticmethod
56
+ def Column () -> ColumnType :
55
57
...
56
58
57
- class Int64 :
58
- ...
59
+ @staticmethod
60
+ def Int64 () -> Int64 :...
61
+ @staticmethod
62
+ def Int16 () -> Int16 :...
59
63
60
- class Int32 :
64
+ @staticmethod
65
+ def Int32 () -> Int32 :
61
66
...
62
67
63
- class Int16 :
64
- ...
65
68
66
- class Int8 :
69
+ @staticmethod
70
+ def Int8 () -> Int8 :
67
71
...
68
72
69
- class UInt64 :
73
+ @staticmethod
74
+ def UInt64 () -> UInt64 :
70
75
...
71
76
72
- class UInt32 :
77
+ @staticmethod
78
+ def UInt32 () -> UInt32 :
73
79
...
74
80
75
- class UInt16 :
81
+ @staticmethod
82
+ def UInt16 () -> UInt16 :
76
83
...
77
84
78
- class UInt8 :
85
+ @staticmethod
86
+ def UInt8 () -> UInt8 :
79
87
...
80
88
81
- class Float64 :
89
+ @staticmethod
90
+ def Float64 () -> Float64 :
82
91
...
83
92
84
- class Float32 :
93
+ @staticmethod
94
+ def Float32 () -> Float32 :
85
95
...
86
96
87
- class Bool :
97
+ @staticmethod
98
+ def Bool () -> Bool :
88
99
...
89
100
90
101
@staticmethod
91
- def concat (dataframes : Sequence [DataFrame ]) -> DataFrame :
102
+ def concat (dataframes : Sequence [DataFrameType ]) -> DataFrameType :
92
103
...
93
104
94
105
@staticmethod
@@ -98,19 +109,19 @@ def column_from_sequence(
98
109
dtype : Any ,
99
110
name : str = "" ,
100
111
api_version : str | None = None ,
101
- ) -> Column :
112
+ ) -> ColumnType :
102
113
...
103
114
104
115
@staticmethod
105
116
def dataframe_from_dict (
106
- data : Mapping [str , Column ], * , api_version : str | None = None
107
- ) -> DataFrame :
117
+ data : Mapping [str , ColumnType ], * , api_version : str | None = None
118
+ ) -> DataFrameType :
108
119
...
109
120
110
121
@staticmethod
111
122
def column_from_1d_array (
112
123
array : Any , * , dtype : Any , name : str = "" , api_version : str | None = None
113
- ) -> Column :
124
+ ) -> ColumnType :
114
125
...
115
126
116
127
@staticmethod
@@ -120,7 +131,7 @@ def dataframe_from_2d_array(
120
131
names : Sequence [str ],
121
132
dtypes : Mapping [str , Any ],
122
133
api_version : str | None = None ,
123
- ) -> DataFrame :
134
+ ) -> DataFrameType :
124
135
...
125
136
126
137
@staticmethod
@@ -135,7 +146,7 @@ def is_dtype(dtype: Any, kind: str | tuple[str, ...]) -> bool:
135
146
class SupportsDataFrameAPI (Protocol ):
136
147
def __dataframe_consortium_standard__ (
137
148
self , * , api_version : str | None = None
138
- ) -> DataFrame :
149
+ ) -> DataFrameType :
139
150
...
140
151
141
152
0 commit comments