Skip to content

Commit 6b49f22

Browse files
vnlitvinovrgommers
authored andcommitted
Format the spec with black
Signed-off-by: Vasily Litvinov <[email protected]>
1 parent 2b35e5d commit 6b49f22

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

protocol/dataframe_protocol.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DtypeKind(enum.IntEnum):
4242
UINT = 1
4343
FLOAT = 2
4444
BOOL = 20
45-
STRING = 21 # UTF-8
45+
STRING = 21 # UTF-8
4646
DATETIME = 22
4747
CATEGORICAL = 23
4848

@@ -73,18 +73,20 @@ class ColumnNullType(enum.IntEnum):
7373

7474

7575
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]]
8890

8991

9092
class Buffer(ABC):
@@ -304,7 +306,7 @@ def num_chunks(self) -> int:
304306
pass
305307

306308
@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"]:
308310
"""
309311
Return an iterator yielding the chunks.
310312
@@ -336,6 +338,7 @@ def get_buffers(self) -> ColumnBuffers:
336338
"""
337339
pass
338340

341+
339342
# def get_children(self) -> Iterable[Column]:
340343
# """
341344
# Children columns underneath the column, each object in this iterator
@@ -359,7 +362,7 @@ class DataFrame(ABC):
359362
to the dataframe interchange protocol specification.
360363
"""
361364

362-
version = 0 # version of the protocol
365+
version = 0 # version of the protocol
363366

364367
@property
365368
@abstractmethod
@@ -442,7 +445,7 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
442445
pass
443446

444447
@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"]:
446449
"""
447450
Return an iterator yielding the chunks.
448451

0 commit comments

Comments
 (0)