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

Function test_ipc_format

python/pyarrow/tests/test_dataset.py:3369–3388  ·  view source on GitHub ↗
(tempdir, dataset_reader)

Source from the content-addressed store, hash-verified

3367
3368
3369def test_ipc_format(tempdir, dataset_reader):
3370 table = pa.table({'a': pa.array([1, 2, 3], type="int8"),
3371 'b': pa.array([.1, .2, .3], type="float64")})
3372
3373 path = str(tempdir / 'test.arrow')
3374 with pa.output_stream(path) as sink:
3375 writer = pa.RecordBatchFileWriter(sink, table.schema)
3376 writer.write_batch(table.to_batches()[0])
3377 writer.close()
3378
3379 dataset = ds.dataset(path, format=ds.IpcFileFormat())
3380 result = dataset_reader.to_table(dataset)
3381 assert result.equals(table)
3382
3383 assert_dataset_fragment_convenience_methods(dataset)
3384
3385 for format_str in ["ipc", "arrow"]:
3386 dataset = ds.dataset(path, format=format_str)
3387 result = dataset_reader.to_table(dataset)
3388 assert result.equals(table)
3389
3390
3391@pytest.mark.orc

Callers

nothing calls this directly

Calls 9

RecordBatchFileWriterMethod · 0.80
write_batchMethod · 0.80
to_batchesMethod · 0.80
IpcFileFormatMethod · 0.80
equalsMethod · 0.80
arrayMethod · 0.45
closeMethod · 0.45
to_tableMethod · 0.45

Tested by

no test coverage detected