4848 DO_NOT_UPDATE_STATS_DEFAULT ,
4949 HIVE_KERBEROS_AUTH ,
5050 HIVE_KERBEROS_SERVICE_NAME ,
51+ HIVE_LOCK_ENABLED ,
5152 LOCK_CHECK_MAX_WAIT_TIME ,
5253 LOCK_CHECK_MIN_WAIT_TIME ,
5354 LOCK_CHECK_RETRIES ,
6869)
6970from pyiceberg .partitioning import PartitionField , PartitionSpec
7071from pyiceberg .schema import Schema
71- from pyiceberg .table import TableProperties
7272from pyiceberg .table .metadata import TableMetadataUtil , TableMetadataV1 , TableMetadataV2
7373from pyiceberg .table .refs import SnapshotRef , SnapshotRefType
7474from pyiceberg .table .snapshots import (
@@ -1420,24 +1420,24 @@ def test_hive_lock_enabled_defaults_to_true() -> None:
14201420
14211421def test_hive_lock_enabled_table_property_disables_lock () -> None :
14221422 """Table property engine.hive.lock-enabled=false disables locking."""
1423- table_props = {TableProperties . HIVE_LOCK_ENABLED : "false" }
1423+ table_props = {HIVE_LOCK_ENABLED : "false" }
14241424 assert HiveCatalog ._hive_lock_enabled (table_properties = table_props , catalog_properties = {}) is False
14251425
14261426
14271427def test_hive_lock_enabled_catalog_property_disables_lock () -> None :
14281428 """Catalog property engine.hive.lock-enabled=false disables locking when table doesn't set it."""
1429- catalog_props = {TableProperties . HIVE_LOCK_ENABLED : "false" }
1429+ catalog_props = {HIVE_LOCK_ENABLED : "false" }
14301430 assert HiveCatalog ._hive_lock_enabled (table_properties = {}, catalog_properties = catalog_props ) is False
14311431
14321432
14331433def test_hive_lock_enabled_table_property_overrides_catalog () -> None :
14341434 """Table property takes precedence over catalog property."""
1435- table_props = {TableProperties . HIVE_LOCK_ENABLED : "true" }
1436- catalog_props = {TableProperties . HIVE_LOCK_ENABLED : "false" }
1435+ table_props = {HIVE_LOCK_ENABLED : "true" }
1436+ catalog_props = {HIVE_LOCK_ENABLED : "false" }
14371437 assert HiveCatalog ._hive_lock_enabled (table_properties = table_props , catalog_properties = catalog_props ) is True
14381438
1439- table_props = {TableProperties . HIVE_LOCK_ENABLED : "false" }
1440- catalog_props = {TableProperties . HIVE_LOCK_ENABLED : "true" }
1439+ table_props = {HIVE_LOCK_ENABLED : "false" }
1440+ catalog_props = {HIVE_LOCK_ENABLED : "true" }
14411441 assert HiveCatalog ._hive_lock_enabled (table_properties = table_props , catalog_properties = catalog_props ) is False
14421442
14431443
@@ -1449,7 +1449,7 @@ def test_commit_table_skips_locking_when_table_property_disables_it() -> None:
14491449
14501450 mock_table = MagicMock ()
14511451 mock_table .name .return_value = ("default" , "my_table" )
1452- mock_table .properties = {TableProperties . HIVE_LOCK_ENABLED : "false" }
1452+ mock_table .properties = {HIVE_LOCK_ENABLED : "false" }
14531453
14541454 mock_do_commit = MagicMock ()
14551455 mock_do_commit .return_value = MagicMock ()
@@ -1467,7 +1467,7 @@ def test_commit_table_skips_locking_when_table_property_disables_it() -> None:
14671467
14681468def test_commit_table_skips_locking_when_catalog_property_disables_it () -> None :
14691469 """When catalog property engine.hive.lock-enabled=false, commit_table must not lock/unlock."""
1470- prop = {"uri" : HIVE_METASTORE_FAKE_URL , TableProperties . HIVE_LOCK_ENABLED : "false" }
1470+ prop = {"uri" : HIVE_METASTORE_FAKE_URL , HIVE_LOCK_ENABLED : "false" }
14711471 catalog = HiveCatalog (HIVE_CATALOG_NAME , ** prop )
14721472 catalog ._client = MagicMock ()
14731473
@@ -1551,8 +1551,13 @@ def test_do_commit_env_context_includes_expected_params_when_lock_disabled() ->
15511551 mock_stage .return_value = mock_staged
15521552
15531553 catalog ._do_commit (
1554- mock_client , ("default" , "my_table" ), "default" , "my_table" ,
1555- requirements = (), updates = (), lock_enabled = False ,
1554+ mock_client ,
1555+ ("default" , "my_table" ),
1556+ "default" ,
1557+ "my_table" ,
1558+ requirements = (),
1559+ updates = (),
1560+ lock_enabled = False ,
15561561 )
15571562
15581563 mock_client .alter_table_with_environment_context .assert_called_once ()
@@ -1594,8 +1599,13 @@ def test_do_commit_env_context_excludes_expected_params_when_lock_enabled() -> N
15941599 mock_stage .return_value = mock_staged
15951600
15961601 catalog ._do_commit (
1597- mock_client , ("default" , "my_table" ), "default" , "my_table" ,
1598- requirements = (), updates = (), lock_enabled = True ,
1602+ mock_client ,
1603+ ("default" , "my_table" ),
1604+ "default" ,
1605+ "my_table" ,
1606+ requirements = (),
1607+ updates = (),
1608+ lock_enabled = True ,
15991609 )
16001610
16011611 mock_client .alter_table_with_environment_context .assert_called_once ()
0 commit comments