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

Function test_ipc_format

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

Source from the content-addressed store, hash-verified

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