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

Function test_stream_options_roundtrip

python/pyarrow/tests/test_ipc.py:535–555  ·  view source on GitHub ↗
(stream_fixture, options)

Source from the content-addressed store, hash-verified

533 metadata_version=pa.ipc.MetadataVersion.V4),
534])
535def test_stream_options_roundtrip(stream_fixture, options):
536 stream_fixture.options = options
537 batches = stream_fixture.write_batches()
538 file_contents = pa.BufferReader(stream_fixture.get_source())
539
540 message = pa.ipc.read_message(stream_fixture.get_source())
541 assert message.metadata_version == options.metadata_version
542
543 reader = pa.ipc.open_stream(file_contents)
544
545 assert reader.schema.equals(batches[0].schema)
546
547 total = 0
548 for i, next_batch in enumerate(reader):
549 assert next_batch.equals(batches[i])
550 total += 1
551
552 assert total == len(batches)
553
554 with pytest.raises(StopIteration):
555 reader.read_next_batch()
556
557
558def test_read_options():

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
write_batchesMethod · 0.80
BufferReaderMethod · 0.80
get_sourceMethod · 0.80
equalsMethod · 0.80

Tested by

no test coverage detected