@@ -58,6 +58,9 @@ class DtypeKind(enum.IntEnum):
58
58
CATEGORICAL = 23
59
59
60
60
61
+ Dtype = Tuple [DtypeKind , int , str , str ] # see Column.dtype
62
+
63
+
61
64
class ColumnNullType (enum .IntEnum ):
62
65
"""
63
66
Integer enum for null type representation.
@@ -86,18 +89,18 @@ class ColumnNullType(enum.IntEnum):
86
89
class ColumnBuffers (TypedDict ):
87
90
# first element is a buffer containing the column data;
88
91
# second element is the data buffer's associated dtype
89
- data : Tuple ["Buffer" , Any ]
92
+ data : Tuple ["Buffer" , Dtype ]
90
93
91
94
# first element is a buffer containing mask values indicating missing data;
92
95
# second element is the mask value buffer's associated dtype.
93
96
# None if the null representation is not a bit or byte mask
94
- validity : Optional [Tuple ["Buffer" , Any ]]
97
+ validity : Optional [Tuple ["Buffer" , Dtype ]]
95
98
96
99
# first element is a buffer containing the offset values for
97
100
# variable-size binary data (e.g., variable-length strings);
98
101
# second element is the offsets buffer's associated dtype.
99
102
# None if the data buffer does not have an associated offsets buffer
100
- offsets : Optional [Tuple ["Buffer" , Any ]]
103
+ offsets : Optional [Tuple ["Buffer" , Dtype ]]
101
104
102
105
103
106
class CategoricalDescription (TypedDict ):
@@ -237,7 +240,7 @@ def offset(self) -> int:
237
240
238
241
@property
239
242
@abstractmethod
240
- def dtype (self ) -> Tuple [ DtypeKind , int , str , str ] :
243
+ def dtype (self ) -> Dtype :
241
244
"""
242
245
Dtype description as a tuple ``(kind, bit-width, format string, endianness)``.
243
246
0 commit comments