File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ def test_maintenance_compact(catalog: Catalog) -> None:
6363 # Verify state before compaction
6464 before_files = list (table .scan ().plan_files ())
6565 assert len (before_files ) == 12
66- assert table .scan ().to_arrow ().num_rows == 120
66+ arrow_table_before = table .scan ().to_arrow ()
67+ assert arrow_table_before .num_rows == 120
6768
6869 # Execute Compaction
6970 table .maintenance .compact ()
@@ -72,7 +73,13 @@ def test_maintenance_compact(catalog: Catalog) -> None:
7273 table .refresh ()
7374 after_files = list (table .scan ().plan_files ())
7475 assert len (after_files ) == 3 # Should be 1 optimized data file per partition
75- assert table .scan ().to_arrow ().num_rows == 120
76+
77+ arrow_table_after = table .scan ().to_arrow ()
78+ assert arrow_table_after .num_rows == 120
79+ assert arrow_table_before .column_names == arrow_table_after .column_names
80+ assert sorted (arrow_table_before .to_pylist (), key = lambda x : x ["id" ]) == sorted (
81+ arrow_table_after .to_pylist (), key = lambda x : x ["id" ]
82+ )
7683
7784 # Ensure snapshot properties specify the replace-operation
7885 new_snapshot = table .current_snapshot ()
You can’t perform that action at this time.
0 commit comments