2424import pytest
2525from hive_metastore .ttypes import LockRequest , LockResponse , LockState , UnlockRequest
2626from pyarrow .fs import S3FileSystem
27+ from pydantic_core import ValidationError
2728
2829from pyiceberg .catalog import Catalog , load_catalog
2930from pyiceberg .catalog .hive import HiveCatalog , _HiveClient
@@ -122,6 +123,10 @@ def test_table_properties(catalog: Catalog) -> None:
122123 table = table .transaction ().set_properties (abc = 123 ).commit_transaction ()
123124 assert table .properties == dict (abc = "123" , ** DEFAULT_PROPERTIES )
124125
126+ with pytest .raises (ValidationError ) as exc_info :
127+ table .transaction ().set_properties (property_name = None ).commit_transaction ()
128+ assert "None type is not a supported value in properties: property_name" in str (exc_info .value )
129+
125130
126131@pytest .mark .integration
127132@pytest .mark .parametrize ('catalog' , [pytest .lazy_fixture ('catalog_hive' ), pytest .lazy_fixture ('catalog_rest' )])
@@ -147,6 +152,10 @@ def test_table_properties_dict(catalog: Catalog) -> None:
147152 table = table .transaction ().set_properties ({"abc" : 123 }).commit_transaction ()
148153 assert table .properties == dict ({"abc" : "123" }, ** DEFAULT_PROPERTIES )
149154
155+ with pytest .raises (ValidationError ) as exc_info :
156+ table .transaction ().set_properties ({"property_name" : None }).commit_transaction ()
157+ assert "None type is not a supported value in properties: property_name" in str (exc_info .value )
158+
150159
151160@pytest .mark .integration
152161@pytest .mark .parametrize ('catalog' , [pytest .lazy_fixture ('catalog_hive' ), pytest .lazy_fixture ('catalog_rest' )])
0 commit comments