Skip to content

Commit

Permalink
check file contents stays same
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Nov 30, 2023
1 parent 0d5a409 commit cd587d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/tests/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ def test_optimize_run_table(
)

dt = DeltaTable(table_path)
old_data = dt.to_pyarrow_table()
old_version = dt.version()
with pytest.warns(DeprecationWarning):
dt.optimize()

dt.optimize.compact()

new_data = dt.to_pyarrow_table()
last_action = dt.history(1)[0]
assert last_action["operation"] == "OPTIMIZE"
assert dt.version() == old_version + 1
assert old_data == new_data


@pytest.mark.parametrize("engine", ["pyarrow", "rust"])
Expand All @@ -60,14 +64,16 @@ def test_z_order_optimize(
)

dt = DeltaTable(tmp_path)
old_data = dt.to_pyarrow_table()
old_version = dt.version()

dt.optimize.z_order(["date32", "timestamp"])

new_data = dt.to_pyarrow_table()
last_action = dt.history(1)[0]
assert last_action["operation"] == "OPTIMIZE"
assert dt.version() == old_version + 1
assert len(dt.file_uris()) == 1
assert old_data == new_data


def test_optimize_min_commit_interval(
Expand Down

0 comments on commit cd587d2

Please sign in to comment.