(tempdir)
| 4254 | @pytest.mark.parquet |
| 4255 | @pytest.mark.pandas |
| 4256 | def test_write_dataset_partitioned(tempdir): |
| 4257 | directory = tempdir / "partitioned" |
| 4258 | _ = _create_parquet_dataset_partitioned(directory) |
| 4259 | partitioning = ds.partitioning(flavor="hive") |
| 4260 | dataset = ds.dataset(directory, partitioning=partitioning) |
| 4261 | |
| 4262 | # hive partitioning |
| 4263 | target = tempdir / 'partitioned-hive-target' |
| 4264 | expected_paths = [ |
| 4265 | target / "part=a", target / "part=a" / "part-0.arrow", |
| 4266 | target / "part=b", target / "part=b" / "part-0.arrow" |
| 4267 | ] |
| 4268 | partitioning_schema = ds.partitioning( |
| 4269 | pa.schema([("part", pa.string())]), flavor="hive") |
| 4270 | _check_dataset_roundtrip( |
| 4271 | dataset, str(target), expected_paths, 'f1', target, |
| 4272 | partitioning=partitioning_schema) |
| 4273 | |
| 4274 | # directory partitioning |
| 4275 | target = tempdir / 'partitioned-dir-target' |
| 4276 | expected_paths = [ |
| 4277 | target / "a", target / "a" / "part-0.arrow", |
| 4278 | target / "b", target / "b" / "part-0.arrow" |
| 4279 | ] |
| 4280 | partitioning_schema = ds.partitioning( |
| 4281 | pa.schema([("part", pa.string())])) |
| 4282 | _check_dataset_roundtrip( |
| 4283 | dataset, str(target), expected_paths, 'f1', target, |
| 4284 | partitioning=partitioning_schema) |
| 4285 | |
| 4286 | |
| 4287 | def test_write_dataset_with_field_names(tempdir): |
nothing calls this directly
no test coverage detected