@@ -42,7 +42,7 @@ class DtypeKind(enum.IntEnum):
42
42
UINT = 1
43
43
FLOAT = 2
44
44
BOOL = 20
45
- STRING = 21 # UTF-8
45
+ STRING = 21 # UTF-8
46
46
DATETIME = 22
47
47
CATEGORICAL = 23
48
48
@@ -73,18 +73,20 @@ class ColumnNullType(enum.IntEnum):
73
73
74
74
75
75
class ColumnBuffers (TypedDict ):
76
- data : Tuple ["Buffer" , Any ] # first element is a buffer containing the column data;
77
- # second element is the data buffer's associated dtype
78
- validity : Optional [Tuple ["Buffer" , Any ]] # first element is a buffer containing mask values
79
- # indicating missing data and second element is
80
- # the mask value buffer's associated dtype.
81
- # None if the null representation is not a bit or byte mask
82
- offsets : Optional [Tuple ["Buffer" , Any ]] # first element is a buffer containing the
83
- # offset values for variable-size binary data
84
- # (e.g., variable-length strings) and
85
- # second element is the offsets buffer's associated dtype.
86
- # None if the data buffer does not have
87
- # an associated offsets buffer
76
+ # first element is a buffer containing the column data;
77
+ # second element is the data buffer's associated dtype
78
+ data : Tuple ["Buffer" , Any ]
79
+
80
+ # first element is a buffer containing mask values indicating missing data;
81
+ # second element is the mask value buffer's associated dtype.
82
+ # None if the null representation is not a bit or byte mask
83
+ validity : Optional [Tuple ["Buffer" , Any ]]
84
+
85
+ # first element is a buffer containing the offset values for
86
+ # variable-size binary data (e.g., variable-length strings);
87
+ # second element is the offsets buffer's associated dtype.
88
+ # None if the data buffer does not have an associated offsets buffer
89
+ offsets : Optional [Tuple ["Buffer" , Any ]]
88
90
89
91
90
92
class Buffer (ABC ):
@@ -304,7 +306,7 @@ def num_chunks(self) -> int:
304
306
pass
305
307
306
308
@abstractmethod
307
- def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["Column" ]:
309
+ def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["Column" ]:
308
310
"""
309
311
Return an iterator yielding the chunks.
310
312
@@ -336,6 +338,7 @@ def get_buffers(self) -> ColumnBuffers:
336
338
"""
337
339
pass
338
340
341
+
339
342
# def get_children(self) -> Iterable[Column]:
340
343
# """
341
344
# Children columns underneath the column, each object in this iterator
@@ -359,7 +362,7 @@ class DataFrame(ABC):
359
362
to the dataframe interchange protocol specification.
360
363
"""
361
364
362
- version = 0 # version of the protocol
365
+ version = 0 # version of the protocol
363
366
364
367
@property
365
368
@abstractmethod
@@ -442,7 +445,7 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
442
445
pass
443
446
444
447
@abstractmethod
445
- def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["DataFrame" ]:
448
+ def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["DataFrame" ]:
446
449
"""
447
450
Return an iterator yielding the chunks.
448
451
0 commit comments