Skip to content

Commit 63ba1e7

Browse files
committed
Format the spec with black
Signed-off-by: Vasily Litvinov <[email protected]>
1 parent ffa1544 commit 63ba1e7

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):
@@ -303,7 +305,7 @@ def num_chunks(self) -> int:
303305
pass
304306

305307
@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"]:
307309
"""
308310
Return an iterator yielding the chunks.
309311
@@ -335,6 +337,7 @@ def get_buffers(self) -> ColumnBuffers:
335337
"""
336338
pass
337339

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

361-
version = 0 # version of the protocol
364+
version = 0 # version of the protocol
362365

363366
@property
364367
@abstractmethod
@@ -441,7 +444,7 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
441444
pass
442445

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

0 commit comments

Comments
 (0)