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

Function test_roundtrip_batch_reader_capsule

python/pyarrow/tests/test_cffi.py:738–747  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

736
737
738def test_roundtrip_batch_reader_capsule():
739 batch = make_batch()
740
741 capsule = batch.__arrow_c_stream__()
742 assert PyCapsule_IsValid(capsule, b"arrow_array_stream") == 1
743 imported_reader = pa.RecordBatchReader._import_from_c_capsule(capsule)
744 assert imported_reader.schema == batch.schema
745 assert imported_reader.read_next_batch().equals(batch)
746 with pytest.raises(StopIteration):
747 imported_reader.read_next_batch()
748
749
750def test_roundtrip_chunked_array_capsule():

Callers

nothing calls this directly

Calls 4

make_batchFunction · 0.85
equalsMethod · 0.80
PyCapsule_IsValidFunction · 0.70
__arrow_c_stream__Method · 0.45

Tested by

no test coverage detected