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

Function _create_partitioned_dataset

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

Source from the content-addressed store, hash-verified

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

Calls 3

write_tableMethod · 0.45
sliceMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected