Skip to content

Commit fcfb54f

Browse files
authored
typing fixups (#301)
1 parent 37ac1f0 commit fcfb54f

File tree

1 file changed

+28
-43
lines changed
  • spec/API_specification/dataframe_api

1 file changed

+28
-43
lines changed

spec/API_specification/dataframe_api/typing.py

+28-43
Original file line numberDiff line numberDiff line change
@@ -65,104 +65,89 @@
6565
class Namespace(Protocol):
6666
__dataframe_api_version__: str
6767

68-
@staticmethod
69-
def Int64() -> Int64:
68+
class Int64():
7069
...
7170

72-
@staticmethod
73-
def Int32() -> Int32:
71+
class Int32():
7472
...
7573

76-
@staticmethod
77-
def Int16() -> Int16:
74+
class Int16():
7875
...
7976

80-
@staticmethod
81-
def Int8() -> Int8:
77+
class Int8():
8278
...
8379

84-
@staticmethod
85-
def UInt64() -> UInt64:
80+
class UInt64():
8681
...
8782

88-
@staticmethod
89-
def UInt32() -> UInt32:
83+
class UInt32():
9084
...
9185

92-
@staticmethod
93-
def UInt16() -> UInt16:
86+
class UInt16():
9487
...
9588

96-
@staticmethod
97-
def UInt8() -> UInt8:
89+
class UInt8():
9890
...
9991

100-
@staticmethod
101-
def Float64() -> Float64:
92+
class Float64():
10293
...
10394

104-
@staticmethod
105-
def Float32() -> Float32:
95+
class Float32():
10696
...
10797

108-
@staticmethod
109-
def Bool() -> Bool:
98+
class Bool():
11099
...
111100

112-
@staticmethod
113-
def Date() -> Date:
101+
class Date():
114102
...
115103

116-
@staticmethod
117-
def Datetime(time_unit: Literal['ms', 'us'], time_zone: str | None) -> Datetime:
118-
...
104+
class Datetime():
105+
def __init__(
106+
self,
107+
time_unit: Literal['ms', 'us'],
108+
time_zone: str | None,
109+
):
110+
...
119111

120-
@staticmethod
121-
def String() -> String:
112+
class String():
122113
...
123114

124-
@staticmethod
125-
def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
115+
def concat(self, dataframes: Sequence[DataFrame]) -> DataFrame:
126116
...
127117

128-
@staticmethod
129118
def column_from_sequence(
119+
self,
130120
sequence: Sequence[Any],
131121
*,
132122
dtype: Any,
133123
name: str = "",
134124
) -> Column:
135125
...
136126

137-
@staticmethod
138-
def dataframe_from_columns(*columns: Column) -> DataFrame:
127+
def dataframe_from_columns(self, *columns: Column) -> DataFrame:
139128
...
140129

141-
@staticmethod
142130
def column_from_1d_array(
143-
array: Any, *, dtype: Any, name: str = ""
131+
self, array: Any, *, dtype: Any, name: str = ""
144132
) -> Column:
145133
...
146134

147-
@staticmethod
148135
def dataframe_from_2d_array(
136+
self,
149137
array: Any,
150138
*,
151139
names: Sequence[str],
152140
dtypes: Mapping[str, Any],
153141
) -> DataFrame:
154142
...
155143

156-
@staticmethod
157-
def is_null(value: object, /) -> bool:
144+
def is_null(self, value: object, /) -> bool:
158145
...
159146

160-
@staticmethod
161-
def is_dtype(dtype: Any, kind: str | tuple[str, ...]) -> bool:
147+
def is_dtype(self, dtype: Any, kind: str | tuple[str, ...]) -> bool:
162148
...
163149

164-
@staticmethod
165-
def date(year: int, month: int, day: int) -> Scalar:
150+
def date(self, year: int, month: int, day: int) -> Scalar:
166151
...
167152

168153
class SupportsDataFrameAPI(Protocol):

0 commit comments

Comments
 (0)