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

Function test_buffer_null_data

python/pyarrow/tests/test_io.py:408–418  ·  view source on GitHub ↗
(pickle_module)

Source from the content-addressed store, hash-verified

406
407
408def test_buffer_null_data(pickle_module):
409 null_buff = pa.foreign_buffer(address=0, size=0)
410 assert null_buff.to_pybytes() == b""
411 assert null_buff.address == 0
412 # ARROW-16048: we shouldn't expose a NULL address through the Python
413 # buffer protocol.
414 m = memoryview(null_buff)
415 assert m.tobytes() == b""
416 assert pa.py_buffer(m).address != 0
417
418 check_buffer_pickling(null_buff, pickle_module)
419
420
421def test_buffer_memoryview(pickle_module):

Callers

nothing calls this directly

Calls 1

check_buffer_picklingFunction · 0.85

Tested by

no test coverage detected