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