@@ -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 ):
@@ -303,7 +305,7 @@ def num_chunks(self) -> int:
303
305
pass
304
306
305
307
@abstractmethod
306
- def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["Column" ]:
308
+ def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["Column" ]:
307
309
"""
308
310
Return an iterator yielding the chunks.
309
311
@@ -335,6 +337,7 @@ def get_buffers(self) -> ColumnBuffers:
335
337
"""
336
338
pass
337
339
340
+
338
341
# def get_children(self) -> Iterable[Column]:
339
342
# """
340
343
# Children columns underneath the column, each object in this iterator
@@ -358,7 +361,7 @@ class DataFrame(ABC):
358
361
to the dataframe interchange protocol specification.
359
362
"""
360
363
361
- version = 0 # version of the protocol
364
+ version = 0 # version of the protocol
362
365
363
366
@property
364
367
@abstractmethod
@@ -441,7 +444,7 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
441
444
pass
442
445
443
446
@abstractmethod
444
- def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["DataFrame" ]:
447
+ def get_chunks (self , n_chunks : Optional [int ] = None ) -> Iterable ["DataFrame" ]:
445
448
"""
446
449
Return an iterator yielding the chunks.
447
450
0 commit comments