Skip to content

Commit be27ba3

Browse files
committed
better error msg
1 parent d475e62 commit be27ba3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/table/test_init.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,9 @@ def test_serialize_commit_table_request() -> None:
11581158

11591159
def test_table_update_have_corresponding_dispatch() -> None:
11601160
from pyiceberg.table import TableUpdate, _apply_table_update
1161-
# every TableUpdate should have a corresponding `_apply_table_update` dispatch function
11621161

1163-
assert len(_apply_table_update.registry) == len(TableUpdate.__origin__.__args__) # type: ignore
1162+
# every TableUpdate class should have corresponding `_apply_table_update` dispatch function
1163+
table_update_class = set(TableUpdate.__origin__.__args__) # type: ignore
1164+
dispatch_function_class = set(_apply_table_update.registry.keys())
1165+
missing_dispatch_function = table_update_class - dispatch_function_class
1166+
assert len(missing_dispatch_function) == 0, f"Missing dispatch function for {missing_dispatch_function}"

0 commit comments

Comments
 (0)