Skip to content

Commit

Permalink
better error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Aug 7, 2024
1 parent 19fbf98 commit edf0c17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/table/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,9 @@ def test_update_metadata_log_overflow(table_v2: Table) -> None:

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

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

0 comments on commit edf0c17

Please sign in to comment.