Skip to content

Commit

Permalink
parametrize write benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Nov 18, 2023
1 parent 9911574 commit a410dfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/deltalake/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def write_deltalake(
table_or_uri: URI of a table or a DeltaTable object.
data: Data to write. If passing iterable, the schema must also be given.
schema: Optional schema to write.
partition_by: List of columns to partition the table by. Only required
partition_by: List of columns to partition the table by. Only required
when creating a new table.
filesystem: Optional filesystem to pass to PyArrow. If not provided will
be inferred from uri. The file system has to be rooted in the table root.
Expand Down
7 changes: 5 additions & 2 deletions python/tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ def sample_table() -> pa.Table:
return tab


@pytest.mark.parametrize("engine", ["pyarrow", "rust"])
@pytest.mark.benchmark(group="write")
def test_benchmark_write(benchmark, sample_table, tmp_path):
benchmark(write_deltalake, str(tmp_path), sample_table, mode="overwrite")
def test_benchmark_write(benchmark, sample_table, tmp_path, engine):
benchmark(
write_deltalake, str(tmp_path), sample_table, mode="overwrite", engine=engine
)

dt = DeltaTable(str(tmp_path))
assert dt.to_pyarrow_table().sort_by("i") == sample_table
Expand Down

0 comments on commit a410dfa

Please sign in to comment.