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

Function test_write_dataset_with_dataset

python/pyarrow/tests/test_dataset.py:4423–4437  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

4421
4422
4423def test_write_dataset_with_dataset(tempdir):
4424 table = pa.table({'b': ['x', 'y', 'z'], 'c': [1, 2, 3]})
4425
4426 ds.write_dataset(table, tempdir, format='ipc',
4427 partitioning=["b"])
4428
4429 dataset = ds.dataset(tempdir, format='ipc', partitioning=["b"])
4430
4431 with tempfile.TemporaryDirectory() as tempdir2:
4432 ds.write_dataset(dataset, tempdir2,
4433 format='ipc', partitioning=["b"])
4434
4435 load_back = ds.dataset(tempdir2, format='ipc', partitioning=["b"])
4436 load_back_table = load_back.to_table()
4437 assert dict(load_back_table.to_pydict()) == table.to_pydict()
4438
4439
4440@pytest.mark.pandas

Callers

nothing calls this directly

Calls 1

to_tableMethod · 0.45

Tested by

no test coverage detected