Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/pyarrow/parquet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3109,6 +3109,12 @@ def file_visitor(written_file):
# extract non-file format options
schema = kwargs.pop("schema", None)
use_threads = kwargs.pop("use_threads", True)
chunk_size = kwargs.pop("chunk_size", None)
row_group_size = kwargs.pop("row_group_size", None)

row_group_size = (
row_group_size if row_group_size is not None else chunk_size
)

# raise for unsupported keywords
msg = (
Expand Down Expand Up @@ -3147,7 +3153,8 @@ def file_visitor(written_file):
partitioning=partitioning, use_threads=use_threads,
file_visitor=file_visitor,
basename_template=basename_template,
existing_data_behavior=existing_data_behavior)
existing_data_behavior=existing_data_behavior,
max_rows_per_group=row_group_size)
return

# warnings and errors when using legecy implementation
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ def _create_dataset_for_fragments(tempdir, chunk_size=None, filesystem=None):
path = str(tempdir / "test_parquet_dataset")

# write_to_dataset currently requires pandas
pq.write_to_dataset(table, path, use_legacy_dataset=True,
pq.write_to_dataset(table, path,
partition_cols=["part"], chunk_size=chunk_size)
dataset = ds.dataset(
path, format="parquet", partitioning="hive", filesystem=filesystem
Expand Down