(stream_fixture, options)
| 533 | metadata_version=pa.ipc.MetadataVersion.V4), |
| 534 | ]) |
| 535 | def 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 | |
| 558 | def test_read_options(): |
nothing calls this directly
no test coverage detected