Skip to content

Commit c5bcea7

Browse files
committed
add placeholder
1 parent 3ab06e2 commit c5bcea7

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

pyiceberg/table/update/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,20 @@ def _(
494494
return base_metadata.model_copy(update={"default_sort_order_id": new_sort_order_id})
495495

496496

497+
@_apply_table_update.register(RemoveSnapshotRefUpdate)
498+
def _(update: RemoveSnapshotRefUpdate, base_metadata: TableMetadata, context: _TableMetadataUpdateContext) -> TableMetadata:
499+
context.add_update(update)
500+
# TODO: implement me
501+
return base_metadata
502+
503+
504+
@_apply_table_update.register(RemoveSnapshotsUpdate)
505+
def _(update: RemoveSnapshotsUpdate, base_metadata: TableMetadata, context: _TableMetadataUpdateContext) -> TableMetadata:
506+
context.add_update(update)
507+
# TODO: implement me
508+
return base_metadata
509+
510+
497511
def update_table_metadata(
498512
base_metadata: TableMetadata,
499513
updates: Tuple[TableUpdate, ...],

tests/table/test_init.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,10 +1260,11 @@ def test_table_module_refactoring_backward_compatibility() -> None:
12601260
raise pytest.fail("Importing moved modules should not raise an exception") from exc
12611261

12621262

1263-
def test_table_update_has_corresponding_dispatch() -> None:
1264-
from pyiceberg.table import TableUpdate, _apply_table_update
1265-
# assert that every TableUpdate has a corresponding `_apply_table_update` dispatch function
1266-
table_update_class = set(TableUpdate.__origin__.__args__) # type: ignore
1267-
dispatch_function_class = set(_apply_table_update.registry.keys())
1268-
missing_dispatch_function = table_update_class - dispatch_function_class
1269-
assert len(missing_dispatch_function) == 0, f"Missing dispatch function for {missing_dispatch_function}"
1263+
def test_all_table_updates_have_dispatch() -> None:
1264+
# ensures that every TableUpdate subclass has a corresponding `_apply_table_update` dispatch function.
1265+
from pyiceberg.table.update import TableUpdate, _apply_table_update
1266+
1267+
table_update_classes = set(TableUpdate.__origin__.__args__) # type: ignore
1268+
dispatch_classes = set(_apply_table_update.registry.keys())
1269+
missing_dispatch = table_update_classes - dispatch_classes
1270+
assert not missing_dispatch, f"Missing dispatch function for: {missing_dispatch}"

0 commit comments

Comments
 (0)