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