(tempdir)
| 4673 | @pytest.mark.parquet |
| 4674 | @pytest.mark.pandas |
| 4675 | def test_write_dataset_partitioned_dict(tempdir): |
| 4676 | directory = tempdir / "partitioned" |
| 4677 | _ = _create_parquet_dataset_partitioned(directory) |
| 4678 | |
| 4679 | # directory partitioning, dictionary partition columns |
| 4680 | dataset = ds.dataset( |
| 4681 | directory, |
| 4682 | partitioning=ds.HivePartitioning.discover(infer_dictionary=True)) |
| 4683 | target = tempdir / 'partitioned-dir-target' |
| 4684 | expected_paths = [ |
| 4685 | target / "a", target / "a" / "part-0.arrow", |
| 4686 | target / "b", target / "b" / "part-0.arrow" |
| 4687 | ] |
| 4688 | partitioning = ds.partitioning(pa.schema([ |
| 4689 | dataset.schema.field('part')]), |
| 4690 | dictionaries={'part': pa.array(['a', 'b'])}) |
| 4691 | # NB: dictionaries required here since we use partitioning to parse |
| 4692 | # directories in _check_dataset_roundtrip (not currently required for |
| 4693 | # the formatting step) |
| 4694 | _check_dataset_roundtrip( |
| 4695 | dataset, str(target), expected_paths, 'f1', target, |
| 4696 | partitioning=partitioning) |
| 4697 | |
| 4698 | |
| 4699 | @pytest.mark.parquet |
nothing calls this directly
no test coverage detected