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:192–212  ·  view source on GitHub ↗
(file_fixture)

Source from the content-addressed store, hash-verified

190
191
192def test_open_file_from_buffer(file_fixture):
193 # ARROW-2859; APIs accept the buffer protocol
194 file_fixture.write_batches()
195 source = file_fixture.get_source()
196
197 reader1 = pa.ipc.open_file(source)
198 reader2 = pa.ipc.open_file(pa.BufferReader(source))
199 reader3 = pa.RecordBatchFileReader(source)
200
201 result1 = reader1.read_all()
202 result2 = reader2.read_all()
203 result3 = reader3.read_all()
204
205 assert result1.equals(result2)
206 assert result1.equals(result3)
207
208 st1 = reader1.stats
209 assert st1.num_messages == 6
210 assert st1.num_record_batches == 5
211 assert reader2.stats == st1
212 assert reader3.stats == st1
213
214
215@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