Return a dictionary containing the underlying buffers. The returned dictionary has the following contents: - "data": a two-element tuple whose first element is a buffer containing the data and whose second element is the data
(self)
| 426 | yield self |
| 427 | |
| 428 | def get_buffers(self) -> ColumnBuffers: |
| 429 | """ |
| 430 | Return a dictionary containing the underlying buffers. |
| 431 | |
| 432 | The returned dictionary has the following contents: |
| 433 | |
| 434 | - "data": a two-element tuple whose first element is a buffer |
| 435 | containing the data and whose second element is the data |
| 436 | buffer's associated dtype. |
| 437 | - "validity": a two-element tuple whose first element is a buffer |
| 438 | containing mask values indicating missing data and |
| 439 | whose second element is the mask value buffer's |
| 440 | associated dtype. None if the null representation is |
| 441 | not a bit or byte mask. |
| 442 | - "offsets": a two-element tuple whose first element is a buffer |
| 443 | containing the offset values for variable-size binary |
| 444 | data (e.g., variable-length strings) and whose second |
| 445 | element is the offsets buffer's associated dtype. None |
| 446 | if the data buffer does not have an associated offsets |
| 447 | buffer. |
| 448 | """ |
| 449 | buffers: ColumnBuffers = { |
| 450 | "data": self._get_data_buffer(), |
| 451 | "validity": None, |
| 452 | "offsets": None, |
| 453 | } |
| 454 | |
| 455 | try: |
| 456 | buffers["validity"] = self._get_validity_buffer() |
| 457 | except NoBufferPresent: |
| 458 | pass |
| 459 | |
| 460 | try: |
| 461 | buffers["offsets"] = self._get_offsets_buffer() |
| 462 | except NoBufferPresent: |
| 463 | pass |
| 464 | |
| 465 | return buffers |
| 466 | |
| 467 | def _get_data_buffer( |
| 468 | self, |