From cd587d2acfb62a10dd83090e40aa0f0115c74b47 Mon Sep 17 00:00:00 2001 From: ion-elgreco <15728914+ion-elgreco@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:04:22 +0100 Subject: [PATCH] check file contents stays same --- python/tests/test_optimize.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/tests/test_optimize.py b/python/tests/test_optimize.py index 54c0a09aee..3d51bb8896 100644 --- a/python/tests/test_optimize.py +++ b/python/tests/test_optimize.py @@ -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"]) @@ -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(