MCPcopy Create free account
hub / github.com/apache/arrow / test_write_dataset_partitioned_dict

Function test_write_dataset_partitioned_dict

python/pyarrow/tests/test_dataset.py:4676–4697  ·  view source on GitHub ↗
(tempdir)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

_check_dataset_roundtripFunction · 0.85
partitioningMethod · 0.80
schemaMethod · 0.45
fieldMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected