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:284–306  ·  view source on GitHub ↗
(stream_fixture)

Source from the content-addressed store, hash-verified

282
283
284def test_open_stream_from_buffer(stream_fixture):
285 # ARROW-2859
286 stream_fixture.write_batches()
287 source = stream_fixture.get_source()
288
289 reader1 = pa.ipc.open_stream(source)
290 reader2 = pa.ipc.open_stream(pa.BufferReader(source))
291 reader3 = pa.RecordBatchStreamReader(source)
292
293 result1 = reader1.read_all()
294 result2 = reader2.read_all()
295 result3 = reader3.read_all()
296
297 assert result1.equals(result2)
298 assert result1.equals(result3)
299
300 st1 = reader1.stats
301 assert st1.num_messages == 6
302 assert st1.num_record_batches == 5
303 assert reader2.stats == st1
304 assert reader3.stats == st1
305
306 assert tuple(st1) == tuple(stream_fixture.write_stats)
307
308
309@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