Skip to content

Commit 73e8e12

Browse files
committed
test error for none
1 parent 6aeb9d2 commit 73e8e12

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/integration/test_reads.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import pytest
2525
from hive_metastore.ttypes import LockRequest, LockResponse, LockState, UnlockRequest
2626
from pyarrow.fs import S3FileSystem
27+
from pydantic_core import ValidationError
2728

2829
from pyiceberg.catalog import Catalog, load_catalog
2930
from 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

Comments
 (0)