File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,20 @@ def _(
494
494
return base_metadata .model_copy (update = {"default_sort_order_id" : new_sort_order_id })
495
495
496
496
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
+
497
511
def update_table_metadata (
498
512
base_metadata : TableMetadata ,
499
513
updates : Tuple [TableUpdate , ...],
Original file line number Diff line number Diff line change @@ -1260,10 +1260,11 @@ def test_table_module_refactoring_backward_compatibility() -> None:
1260
1260
raise pytest .fail ("Importing moved modules should not raise an exception" ) from exc
1261
1261
1262
1262
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 } "
You can’t perform that action at this time.
0 commit comments