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

Function test_open_file_from_buffer

python/pyarrow/tests/test_ipc.py:216–236  ·  view source on GitHub ↗
(file_fixture)

Source from the content-addressed store, hash-verified

214
215
216def test_open_file_from_buffer(file_fixture):
217 # ARROW-2859; APIs accept the buffer protocol
218 file_fixture.write_batches()
219 source = file_fixture.get_source()
220
221 reader1 = pa.ipc.open_file(source)
222 reader2 = pa.ipc.open_file(pa.BufferReader(source))
223 reader3 = pa.RecordBatchFileReader(source)
224
225 result1 = reader1.read_all()
226 result2 = reader2.read_all()
227 result3 = reader3.read_all()
228
229 assert result1.equals(result2)
230 assert result1.equals(result3)
231
232 st1 = reader1.stats
233 assert st1.num_messages == 6
234 assert st1.num_record_batches == 5
235 assert reader2.stats == st1
236 assert reader3.stats == st1
237
238
239@pytest.mark.pandas

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected