@@ -37,10 +37,10 @@ def test_retain_last_n_snapshots(table_v2: Table) -> None:
3737 (5 , 5000 ),
3838 ]
3939 snapshots = _make_snapshots (ids_and_ts )
40-
40+
4141 # Save original catalog for cleanup
4242 original_catalog = table_v2 .catalog
43-
43+
4444 try :
4545 table_v2 .metadata = table_v2 .metadata .model_copy (update = {"snapshots" : snapshots , "refs" : {}})
4646 table_v2 .catalog = MagicMock ()
@@ -61,7 +61,7 @@ def test_retain_last_n_snapshots(table_v2: Table) -> None:
6161 finally :
6262 # Restore original catalog and cleanup
6363 table_v2 .catalog = original_catalog
64- if hasattr (original_catalog , ' _connection' ) and original_catalog ._connection is not None :
64+ if hasattr (original_catalog , " _connection" ) and original_catalog ._connection is not None :
6565 try :
6666 original_catalog ._connection .close ()
6767 except Exception :
@@ -78,10 +78,10 @@ def test_min_snapshots_to_keep(table_v2: Table) -> None:
7878 (5 , 5000 ),
7979 ]
8080 snapshots = _make_snapshots (ids_and_ts )
81-
81+
8282 # Save original catalog for cleanup
8383 original_catalog = table_v2 .catalog
84-
84+
8585 try :
8686 table_v2 .metadata = table_v2 .metadata .model_copy (update = {"snapshots" : snapshots , "refs" : {}})
8787 table_v2 .catalog = MagicMock ()
@@ -101,7 +101,7 @@ def test_min_snapshots_to_keep(table_v2: Table) -> None:
101101 finally :
102102 # Restore original catalog and cleanup
103103 table_v2 .catalog = original_catalog
104- if hasattr (original_catalog , ' _connection' ) and original_catalog ._connection is not None :
104+ if hasattr (original_catalog , " _connection" ) and original_catalog ._connection is not None :
105105 try :
106106 original_catalog ._connection .close ()
107107 except Exception :
@@ -336,7 +336,7 @@ def test_expire_snapshots_by_ids(table_v2: Table) -> None:
336336 finally :
337337 # Restore original catalog and cleanup any connections
338338 table_v2 .catalog = original_catalog
339- if hasattr (original_catalog , ' _connection' ) and original_catalog ._connection is not None :
339+ if hasattr (original_catalog , " _connection" ) and original_catalog ._connection is not None :
340340 try :
341341 original_catalog ._connection .close ()
342342 except Exception :
@@ -354,13 +354,13 @@ def test_expire_snapshots_with_table_property_defaults(table_v2: Table) -> None:
354354 (5 , 5000 ), # Should be kept (newer than max age)
355355 ]
356356 snapshots = _make_snapshots (ids_and_ts )
357-
357+
358358 # Set table properties
359359 properties = {
360360 "history.expire.max-snapshot-age-ms" : "4500" , # Keep snapshots newer than this
361- "history.expire.min-snapshots-to-keep" : "3" , # Always keep at least 3 snapshots
361+ "history.expire.min-snapshots-to-keep" : "3" , # Always keep at least 3 snapshots
362362 }
363-
363+
364364 table_v2 .metadata = table_v2 .metadata .model_copy (
365365 update = {
366366 "snapshots" : snapshots ,
@@ -399,13 +399,13 @@ def test_explicit_parameters_override_table_properties(table_v2: Table) -> None:
399399 (5 , 5000 ), # Will be kept (min snapshots)
400400 ]
401401 snapshots = _make_snapshots (ids_and_ts )
402-
402+
403403 # Set table properties that are more aggressive than what we'll use
404404 properties = {
405405 "history.expire.max-snapshot-age-ms" : "1500" , # Would expire more snapshots
406- "history.expire.min-snapshots-to-keep" : "2" , # Would keep fewer snapshots
406+ "history.expire.min-snapshots-to-keep" : "2" , # Would keep fewer snapshots
407407 }
408-
408+
409409 table_v2 .metadata = table_v2 .metadata .model_copy (
410410 update = {
411411 "snapshots" : snapshots ,
@@ -427,7 +427,7 @@ def test_explicit_parameters_override_table_properties(table_v2: Table) -> None:
427427 # Call expire with explicit parameters that should override the properties
428428 table_v2 .maintenance .expire_snapshots_with_retention_policy (
429429 timestamp_ms = 1500 , # Only expire snapshots older than this
430- min_snapshots_to_keep = 4 # Keep at least 4 snapshots (overrides property of 2)
430+ min_snapshots_to_keep = 4 , # Keep at least 4 snapshots (overrides property of 2)
431431 )
432432
433433 table_v2 .catalog .commit_table .assert_called_once ()
@@ -447,7 +447,7 @@ def test_expire_snapshots_no_properties_no_parameters(table_v2: Table) -> None:
447447 (5 , 5000 ),
448448 ]
449449 snapshots = _make_snapshots (ids_and_ts )
450-
450+
451451 table_v2 .metadata = table_v2 .metadata .model_copy (
452452 update = {
453453 "snapshots" : snapshots ,
0 commit comments