Return the buffer containing the data and the buffer's associated dtype.
(
self,
)
| 465 | return buffers |
| 466 | |
| 467 | def _get_data_buffer( |
| 468 | self, |
| 469 | ) -> Tuple[_PyArrowBuffer, Any]: # Any is for self.dtype tuple |
| 470 | """ |
| 471 | Return the buffer containing the data and the buffer's |
| 472 | associated dtype. |
| 473 | """ |
| 474 | array = self._col |
| 475 | dtype = self.dtype |
| 476 | |
| 477 | # In case of dictionary arrays, use indices |
| 478 | # to define a buffer, codes are transferred through |
| 479 | # describe_categorical() |
| 480 | if pa.types.is_dictionary(array.type): |
| 481 | array = array.indices |
| 482 | dtype = _PyArrowColumn(array).dtype |
| 483 | |
| 484 | n = len(array.buffers()) |
| 485 | if n == 2: |
| 486 | return _PyArrowBuffer(array.buffers()[1]), dtype |
| 487 | elif n == 3: |
| 488 | return _PyArrowBuffer(array.buffers()[2]), dtype |
| 489 | |
| 490 | def _get_validity_buffer(self) -> Tuple[_PyArrowBuffer, Any]: |
| 491 | """ |
no test coverage detected