| 4291 | |
| 4292 | |
| 4293 | def test_write_dataset_with_field_names(tempdir): |
| 4294 | table = pa.table({'a': ['x', 'y', None], 'b': ['x', 'y', 'z']}) |
| 4295 | |
| 4296 | ds.write_dataset(table, tempdir, format='ipc', |
| 4297 | partitioning=["b"]) |
| 4298 | |
| 4299 | load_back = ds.dataset(tempdir, format='ipc', partitioning=["b"]) |
| 4300 | files = load_back.files |
| 4301 | partitioning_dirs = { |
| 4302 | str(pathlib.Path(f).relative_to(tempdir).parent) for f in files |
| 4303 | } |
| 4304 | assert partitioning_dirs == {"x", "y", "z"} |
| 4305 | |
| 4306 | load_back_table = load_back.to_table() |
| 4307 | assert load_back_table.equals(table) |
| 4308 | |
| 4309 | |
| 4310 | def test_write_dataset_with_field_names_hive(tempdir): |