MCPcopy Create free account
hub / github.com/apache/arrow / _get_validity_buffer

Method _get_validity_buffer

python/pyarrow/interchange/column.py:490–506  ·  view source on GitHub ↗

Return the buffer containing the mask values indicating missing data and the buffer's associated dtype. Raises NoBufferPresent if null representation is not a bit or byte mask.

(self)

Source from the content-addressed store, hash-verified

488 return _PyArrowBuffer(array.buffers()[2]), dtype
489
490 def _get_validity_buffer(self) -> Tuple[_PyArrowBuffer, Any]:
491 """
492 Return the buffer containing the mask values indicating missing data
493 and the buffer's associated dtype.
494 Raises NoBufferPresent if null representation is not a bit or byte
495 mask.
496 """
497 # Define the dtype of the returned buffer
498 dtype = (DtypeKind.BOOL, 1, "b", Endianness.NATIVE)
499 array = self._col
500 buff = array.buffers()[0]
501 if buff:
502 return _PyArrowBuffer(buff), dtype
503 else:
504 raise NoBufferPresent(
505 "There are no missing values so "
506 "does not have a separate mask")
507
508 def _get_offsets_buffer(self) -> Tuple[_PyArrowBuffer, Any]:
509 """

Callers 1

get_buffersMethod · 0.95

Calls 3

_PyArrowBufferClass · 0.90
NoBufferPresentClass · 0.85
buffersMethod · 0.80

Tested by

no test coverage detected