Skip to content

Commit 53b4353

Browse files
committed
fixup
1 parent 53f9c76 commit 53b4353

File tree

1 file changed

+35
-24
lines changed
  • spec/API_specification/dataframe_api

1 file changed

+35
-24
lines changed

spec/API_specification/dataframe_api/_types.py

+35-24
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
Sequence,
1515
Tuple,
1616
Union,
17-
TYPE_CHECKING,
1817
)
1918

2019
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
2222

2323
if TYPE_CHECKING:
2424
from .dtypes import (
@@ -48,47 +48,58 @@
4848
class Namespace(Protocol):
4949
__dataframe_api_version__: str
5050

51-
class DataFrame:
51+
@staticmethod
52+
def DataFrame() -> DataFrameType:
5253
...
5354

54-
class Column:
55+
@staticmethod
56+
def Column() -> ColumnType:
5557
...
5658

57-
class Int64:
58-
...
59+
@staticmethod
60+
def Int64() -> Int64:...
61+
@staticmethod
62+
def Int16() -> Int16:...
5963

60-
class Int32:
64+
@staticmethod
65+
def Int32() -> Int32:
6166
...
6267

63-
class Int16:
64-
...
6568

66-
class Int8:
69+
@staticmethod
70+
def Int8() -> Int8:
6771
...
6872

69-
class UInt64:
73+
@staticmethod
74+
def UInt64() -> UInt64:
7075
...
7176

72-
class UInt32:
77+
@staticmethod
78+
def UInt32() -> UInt32:
7379
...
7480

75-
class UInt16:
81+
@staticmethod
82+
def UInt16() -> UInt16:
7683
...
7784

78-
class UInt8:
85+
@staticmethod
86+
def UInt8() -> UInt8:
7987
...
8088

81-
class Float64:
89+
@staticmethod
90+
def Float64() -> Float64:
8291
...
8392

84-
class Float32:
93+
@staticmethod
94+
def Float32() -> Float32:
8595
...
8696

87-
class Bool:
97+
@staticmethod
98+
def Bool() -> Bool:
8899
...
89100

90101
@staticmethod
91-
def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
102+
def concat(dataframes: Sequence[DataFrameType]) -> DataFrameType:
92103
...
93104

94105
@staticmethod
@@ -98,19 +109,19 @@ def column_from_sequence(
98109
dtype: Any,
99110
name: str = "",
100111
api_version: str | None = None,
101-
) -> Column:
112+
) -> ColumnType:
102113
...
103114

104115
@staticmethod
105116
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:
108119
...
109120

110121
@staticmethod
111122
def column_from_1d_array(
112123
array: Any, *, dtype: Any, name: str = "", api_version: str | None = None
113-
) -> Column:
124+
) -> ColumnType:
114125
...
115126

116127
@staticmethod
@@ -120,7 +131,7 @@ def dataframe_from_2d_array(
120131
names: Sequence[str],
121132
dtypes: Mapping[str, Any],
122133
api_version: str | None = None,
123-
) -> DataFrame:
134+
) -> DataFrameType:
124135
...
125136

126137
@staticmethod
@@ -135,7 +146,7 @@ def is_dtype(dtype: Any, kind: str | tuple[str, ...]) -> bool:
135146
class SupportsDataFrameAPI(Protocol):
136147
def __dataframe_consortium_standard__(
137148
self, *, api_version: str | None = None
138-
) -> DataFrame:
149+
) -> DataFrameType:
139150
...
140151

141152

0 commit comments

Comments
 (0)