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

Function _create_partitioned_dataset

python/pyarrow/tests/test_dataset.py:2711–2725  ·  view source on GitHub ↗
(basedir)

Source from the content-addressed store, hash-verified

2709
2710
2711def _create_partitioned_dataset(basedir):
2712 table = pa.table({'a': range(9), 'b': [0.] * 4 + [1.] * 5})
2713
2714 path = basedir / "dataset-partitioned"
2715 path.mkdir()
2716
2717 for i in range(3):
2718 part = path / f"part={i}"
2719 part.mkdir()
2720 pq.write_table(table.slice(3*i, 3), part / "test.parquet")
2721
2722 full_table = table.append_column(
2723 "part", pa.array([0] * 3 + [1] * 3 + [2] * 3, type=pa.int32()))
2724
2725 return full_table, path
2726
2727
2728@pytest.mark.parquet

Calls 3

write_tableMethod · 0.45
sliceMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected