Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Feb 6, 2024
1 parent 2e6a338 commit 723f91f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,3 +1251,24 @@ def test_with_deltalake_schema(tmp_path: pathlib.Path, sample_data: pa.Table):
)
delta_table = DeltaTable(tmp_path)
assert delta_table.schema().to_pyarrow() == sample_data.schema


def test_write_stats_empty_rowgroups_2169(tmp_path: pathlib.Path):
data = pa.table(
{
"data": pa.array(["B"] * 1024 * 33),
}
)
write_deltalake(
tmp_path,
data,
max_rows_per_file=1024 * 32,
max_rows_per_group=1024 * 16,
min_rows_per_group=8 * 1024,
mode="overwrite",
)
dt = DeltaTable(tmp_path)
assert (
dt.to_pyarrow_dataset().to_table(filter=(pc.field("data") == "B")).shape[0]
== 33792
)

0 comments on commit 723f91f

Please sign in to comment.