Skip to content

Commit 11af5fd

Browse files
committed
test: add test for optimize idempotent behavior in aggregate DataFrame
1 parent 1a6730b commit 11af5fd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

python/tests/test_dataframe.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,20 @@ def test_optimized_logical_plan(aggregate_df):
12671267
assert expected == plan.display_indent()
12681268

12691269

1270+
def test_optimize_idempotent(aggregate_df):
1271+
"""Running optimize twice should yield the same plan.
1272+
1273+
Requires PyArrow >=21.0.0 to match CI environment."""
1274+
1275+
optimized_once = aggregate_df.optimize()
1276+
optimized_twice = optimized_once.optimize()
1277+
1278+
assert (
1279+
optimized_once.logical_plan().display_indent()
1280+
== optimized_twice.logical_plan().display_indent()
1281+
)
1282+
1283+
12701284
def test_execution_plan(aggregate_df):
12711285
plan = aggregate_df.execution_plan()
12721286

0 commit comments

Comments
 (0)