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:457–470  ·  view source on GitHub ↗
(reader_factory)

Source from the content-addressed store, hash-verified

455 [make_ipc_stream_reader,
456 make_py_record_batch_reader])
457def test_export_import_batch_reader(reader_factory):
458 c_stream = ffi.new("struct ArrowArrayStream*")
459 ptr_stream = int(ffi.cast("uintptr_t", c_stream))
460
461 gc.collect() # Make sure no Arrow data dangles in a ref cycle
462 old_allocated = pa.total_allocated_bytes()
463
464 _export_import_batch_reader(ptr_stream, reader_factory)
465
466 assert pa.total_allocated_bytes() == old_allocated
467
468 # Now released
469 with assert_stream_released:
470 pa.RecordBatchReader._import_from_c(ptr_stream)
471
472
473@needs_cffi

Callers

nothing calls this directly

Calls 3

newMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected