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

Function test_stream_options_roundtrip

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

Source from the content-addressed store, hash-verified

509 metadata_version=pa.ipc.MetadataVersion.V4),
510])
511def test_stream_options_roundtrip(stream_fixture, options):
512 stream_fixture.options = options
513 batches = stream_fixture.write_batches()
514 file_contents = pa.BufferReader(stream_fixture.get_source())
515
516 message = pa.ipc.read_message(stream_fixture.get_source())
517 assert message.metadata_version == options.metadata_version
518
519 reader = pa.ipc.open_stream(file_contents)
520
521 assert reader.schema.equals(batches[0].schema)
522
523 total = 0
524 for i, next_batch in enumerate(reader):
525 assert next_batch.equals(batches[i])
526 total += 1
527
528 assert total == len(batches)
529
530 with pytest.raises(StopIteration):
531 reader.read_next_batch()
532
533
534def 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