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