| 4421 | |
| 4422 | |
| 4423 | def 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 |