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

Function test_export_import_batch_reader

python/pyarrow/tests/test_cffi.py:490–503  ·  view source on GitHub ↗
(reader_factory)

Source from the content-addressed store, hash-verified

488 [make_ipc_stream_reader,
489 make_py_record_batch_reader])
490def test_export_import_batch_reader(reader_factory):
491 c_stream = ffi.new("struct ArrowArrayStream*")
492 ptr_stream = int(ffi.cast("uintptr_t", c_stream))
493
494 gc.collect() # Make sure no Arrow data dangles in a ref cycle
495 old_allocated = pa.total_allocated_bytes()
496
497 _export_import_batch_reader(ptr_stream, reader_factory)
498
499 assert pa.total_allocated_bytes() == old_allocated
500
501 # Now released
502 with assert_stream_released:
503 pa.RecordBatchReader._import_from_c(ptr_stream)
504
505
506@needs_cffi

Callers

nothing calls this directly

Calls 3

newMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected