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

Method view

cpp/gdb_arrow.py:692–707  ·  view source on GitHub ↗

Return a view over the primitive values in this buffer. The optional `offset` and `length` are expressed in primitive values, not bytes.

(self, offset=0, length=None)

Source from the content-addressed store, hash-verified

690 return cls(val, mem_format)
691
692 def view(self, offset=0, length=None):
693 """
694 Return a view over the primitive values in this buffer.
695
696 The optional `offset` and `length` are expressed in primitive values,
697 not bytes.
698 """
699 if self.is_boolean:
700 return Bitmap.from_buffer(self, offset, length)
701
702 byte_offset = offset * self.byte_width
703 if length is not None:
704 mem = self.bytes_view(byte_offset, length * self.byte_width)
705 else:
706 mem = self.bytes_view(byte_offset)
707 return TypedView(mem, self.mem_format)
708
709 @property
710 def is_boolean(self):

Callers 8

test_validMethod · 0.45
test_invalidMethod · 0.45
_reconstruct_blockFunction · 0.45
test_viewFunction · 0.45
test_non_cpu_arrayFunction · 0.45
make_columnFunction · 0.45
_buffer_valuesMethod · 0.45

Calls 3

TypedViewClass · 0.85
bytes_viewMethod · 0.80
from_bufferMethod · 0.45

Tested by 5

test_validMethod · 0.36
test_invalidMethod · 0.36
test_viewFunction · 0.36
test_non_cpu_arrayFunction · 0.36