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

Function test_ipc_format

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

Source from the content-addressed store, hash-verified

3372
3373
3374def test_ipc_format(tempdir, dataset_reader):
3375 table = pa.table({'a': pa.array([1, 2, 3], type="int8"),
3376 'b': pa.array([.1, .2, .3], type="float64")})
3377
3378 path = str(tempdir / 'test.arrow')
3379 with pa.output_stream(path) as sink:
3380 writer = pa.RecordBatchFileWriter(sink, table.schema)
3381 writer.write_batch(table.to_batches()[0])
3382 writer.close()
3383
3384 dataset = ds.dataset(path, format=ds.IpcFileFormat())
3385 result = dataset_reader.to_table(dataset)
3386 assert result.equals(table)
3387
3388 assert_dataset_fragment_convenience_methods(dataset)
3389
3390 for format_str in ["ipc", "arrow"]:
3391 dataset = ds.dataset(path, format=format_str)
3392 result = dataset_reader.to_table(dataset)
3393 assert result.equals(table)
3394
3395
3396@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