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

Function test_open_stream_from_buffer

python/pyarrow/tests/test_ipc.py:308–330  ·  view source on GitHub ↗
(stream_fixture)

Source from the content-addressed store, hash-verified

306
307
308def test_open_stream_from_buffer(stream_fixture):
309 # ARROW-2859
310 stream_fixture.write_batches()
311 source = stream_fixture.get_source()
312
313 reader1 = pa.ipc.open_stream(source)
314 reader2 = pa.ipc.open_stream(pa.BufferReader(source))
315 reader3 = pa.RecordBatchStreamReader(source)
316
317 result1 = reader1.read_all()
318 result2 = reader2.read_all()
319 result3 = reader3.read_all()
320
321 assert result1.equals(result2)
322 assert result1.equals(result3)
323
324 st1 = reader1.stats
325 assert st1.num_messages == 6
326 assert st1.num_record_batches == 5
327 assert reader2.stats == st1
328 assert reader3.stats == st1
329
330 assert tuple(st1) == tuple(stream_fixture.write_stats)
331
332
333@pytest.mark.parametrize('options', [

Callers

nothing calls this directly

Calls 5

write_batchesMethod · 0.80
get_sourceMethod · 0.80
BufferReaderMethod · 0.80
equalsMethod · 0.80

Tested by

no test coverage detected