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

Function test_BufferReader_zero_size

python/pyarrow/tests/test_cuda.py:678–687  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676
677
678def test_BufferReader_zero_size():
679 arr, cbuf = make_random_buffer(size=0, target='device')
680 reader = cuda.BufferReader(cbuf)
681 reader.seek(0)
682 data = reader.read()
683 assert len(data) == 0
684 assert reader.tell() == 0
685 buf2 = reader.read_buffer()
686 arr2 = np.frombuffer(buf2.copy_to_host(), dtype=np.uint8)
687 np.testing.assert_equal(arr, arr2)
688
689
690def make_recordbatch(length):

Callers

nothing calls this directly

Calls 6

lenFunction · 0.85
BufferReaderMethod · 0.80
seekMethod · 0.80
read_bufferMethod · 0.80
make_random_bufferFunction · 0.70
readMethod · 0.45

Tested by

no test coverage detected