@@ -52,7 +52,7 @@ def test_retain_last_n_snapshots(table_v2: Table) -> None:
5252 uuid = uuid4 (),
5353 )
5454 table_v2 .catalog .commit_table .return_value = mock_response
55- table_v2 .maintenance .retain_last_n_snapshots (3 )
55+ table_v2 .maintenance .expire_snapshots (). retain_last_n (3 )
5656 table_v2 .catalog .commit_table .assert_called_once ()
5757 # Update metadata to reflect commit
5858 table_v2 .metadata = mock_response .metadata
@@ -93,7 +93,7 @@ def test_min_snapshots_to_keep(table_v2: Table) -> None:
9393 uuid = uuid4 (),
9494 )
9595 table_v2 .catalog .commit_table .return_value = mock_response
96- table_v2 .maintenance .expire_snapshots_older_than_with_retention (timestamp_ms = 4500 , min_snapshots_to_keep = 3 )
96+ table_v2 .maintenance .expire_snapshots (). older_than_with_retention (timestamp_ms = 4500 , min_snapshots_to_keep = 3 )
9797 table_v2 .catalog .commit_table .assert_called_once ()
9898 table_v2 .metadata = mock_response .metadata
9999 remaining_ids = {s .snapshot_id for s in table_v2 .metadata .snapshots }
@@ -128,7 +128,7 @@ def test_combined_constraints(table_v2: Table) -> None:
128128 uuid = uuid4 (),
129129 )
130130 table_v2 .catalog .commit_table .return_value = mock_response
131- table_v2 .maintenance .expire_snapshots_with_retention_policy (timestamp_ms = 3500 , retain_last_n = 2 , min_snapshots_to_keep = 4 )
131+ table_v2 .maintenance .expire_snapshots (). with_retention_policy (timestamp_ms = 3500 , retain_last_n = 2 , min_snapshots_to_keep = 4 )
132132 table_v2 .catalog .commit_table .assert_called_once ()
133133 table_v2 .metadata = mock_response .metadata
134134 remaining_ids = {s .snapshot_id for s in table_v2 .metadata .snapshots }
@@ -156,7 +156,7 @@ def test_cannot_expire_protected_head_snapshot(table_v2: Table) -> None:
156156
157157 # Attempt to expire the HEAD snapshot and expect a ValueError
158158 with pytest .raises (ValueError , match = f"Snapshot with ID { HEAD_SNAPSHOT } is protected and cannot be expired." ):
159- table_v2 .maintenance .expire_snapshot_by_id (HEAD_SNAPSHOT )
159+ table_v2 .maintenance .expire_snapshots (). by_id (HEAD_SNAPSHOT )
160160
161161 table_v2 .catalog .commit_table .assert_not_called ()
162162
@@ -179,7 +179,7 @@ def test_cannot_expire_tagged_snapshot(table_v2: Table) -> None:
179179 assert any (ref .snapshot_id == TAGGED_SNAPSHOT for ref in table_v2 .metadata .refs .values ())
180180
181181 with pytest .raises (ValueError , match = f"Snapshot with ID { TAGGED_SNAPSHOT } is protected and cannot be expired." ):
182- table_v2 .maintenance .expire_snapshot_by_id (TAGGED_SNAPSHOT )
182+ table_v2 .maintenance .expire_snapshots (). by_id (TAGGED_SNAPSHOT )
183183
184184 table_v2 .catalog .commit_table .assert_not_called ()
185185
@@ -211,7 +211,7 @@ def test_expire_unprotected_snapshot(table_v2: Table) -> None:
211211 assert all (ref .snapshot_id != EXPIRE_SNAPSHOT for ref in table_v2 .metadata .refs .values ())
212212
213213 # Expire the snapshot
214- table_v2 .maintenance .expire_snapshot_by_id (EXPIRE_SNAPSHOT )
214+ table_v2 .maintenance .expire_snapshots (). by_id (EXPIRE_SNAPSHOT )
215215
216216 table_v2 .catalog .commit_table .assert_called_once ()
217217 remaining_snapshots = table_v2 .metadata .snapshots
@@ -227,7 +227,7 @@ def test_expire_nonexistent_snapshot_raises(table_v2: Table) -> None:
227227 table_v2 .metadata = table_v2 .metadata .model_copy (update = {"refs" : {}})
228228
229229 with pytest .raises (ValueError , match = f"Snapshot with ID { NONEXISTENT_SNAPSHOT } does not exist." ):
230- table_v2 .maintenance .expire_snapshot_by_id (NONEXISTENT_SNAPSHOT )
230+ table_v2 .maintenance .expire_snapshots (). by_id (NONEXISTENT_SNAPSHOT )
231231
232232 table_v2 .catalog .commit_table .assert_not_called ()
233233
@@ -265,7 +265,7 @@ def test_expire_snapshots_by_timestamp_skips_protected(table_v2: Table) -> None:
265265 )
266266 table_v2 .catalog .commit_table .return_value = mock_response
267267
268- table_v2 .maintenance .expire_snapshots_older_than (future_timestamp )
268+ table_v2 .maintenance .expire_snapshots (). older_than (future_timestamp )
269269
270270 # Both protected snapshots should remain
271271 remaining_ids = {s .snapshot_id for s in table_v2 .metadata .snapshots }
@@ -326,7 +326,7 @@ def test_expire_snapshots_by_ids(table_v2: Table) -> None:
326326 assert all (ref .snapshot_id not in (EXPIRE_SNAPSHOT_1 , EXPIRE_SNAPSHOT_2 ) for ref in table_v2 .metadata .refs .values ())
327327
328328 # Expire the snapshots
329- table_v2 .maintenance ._expire_snapshots_by_ids ([EXPIRE_SNAPSHOT_1 , EXPIRE_SNAPSHOT_2 ])
329+ table_v2 .maintenance .expire_snapshots (). by_ids ([EXPIRE_SNAPSHOT_1 , EXPIRE_SNAPSHOT_2 ])
330330
331331 table_v2 .catalog .commit_table .assert_called_once ()
332332 remaining_snapshots = table_v2 .metadata .snapshots
@@ -380,7 +380,7 @@ def test_expire_snapshots_with_table_property_defaults(table_v2: Table) -> None:
380380 table_v2 .catalog .commit_table .return_value = mock_response
381381
382382 # Call expire without explicit parameters - should use table properties
383- table_v2 .maintenance .expire_snapshots_with_retention_policy ()
383+ table_v2 .maintenance .expire_snapshots (). with_retention_policy ()
384384
385385 table_v2 .catalog .commit_table .assert_called_once ()
386386 table_v2 .metadata = mock_response .metadata
@@ -425,7 +425,7 @@ def test_explicit_parameters_override_table_properties(table_v2: Table) -> None:
425425 table_v2 .catalog .commit_table .return_value = mock_response
426426
427427 # Call expire with explicit parameters that should override the properties
428- table_v2 .maintenance .expire_snapshots_with_retention_policy (
428+ table_v2 .maintenance .expire_snapshots (). with_retention_policy (
429429 timestamp_ms = 1500 , # Only expire snapshots older than this
430430 min_snapshots_to_keep = 4 , # Keep at least 4 snapshots (overrides property of 2)
431431 )
@@ -458,7 +458,7 @@ def test_expire_snapshots_no_properties_no_parameters(table_v2: Table) -> None:
458458 table_v2 .catalog = MagicMock ()
459459
460460 # Call expire with no parameters
461- table_v2 .maintenance .expire_snapshots_with_retention_policy ()
461+ table_v2 .maintenance .expire_snapshots (). with_retention_policy ()
462462
463463 # Should not attempt to expire anything since no criteria were provided
464464 table_v2 .catalog .commit_table .assert_not_called ()
0 commit comments