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

Function _create_partitioned_dataset

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

Source from the content-addressed store, hash-verified

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

Calls 3

write_tableMethod · 0.45
sliceMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected