@@ -81,7 +81,7 @@ def _deleted_data_files(
8181 table : Table ,
8282 starting_snapshot : Snapshot ,
8383 data_filter : Optional [BooleanExpression ],
84- partition_set : Optional [set [Record ]],
84+ partition_set : Optional [dict [ int , set [Record ] ]],
8585 parent_snapshot : Optional [Snapshot ],
8686) -> Iterator [ManifestEntry ]:
8787 """Find deleted data files matching a filter since a starting snapshot.
@@ -90,7 +90,7 @@ def _deleted_data_files(
9090 table: Table to validate
9191 starting_snapshot: Snapshot current at the start of the operation
9292 data_filter: Expression used to find deleted data files
93- partition_set: a set of partitions to find deleted data files
93+ partition_set: dict of {spec_id: set[partition]} to filter on
9494 parent_snapshot: Ending snapshot on the branch being validated
9595
9696 Returns:
@@ -122,8 +122,11 @@ def _deleted_data_files(
122122 if data_filter is not None and evaluator (entry .data_file ) is ROWS_CANNOT_MATCH :
123123 continue
124124
125- if partition_set is not None and (entry .data_file .spec_id , entry .data_file .partition ) not in partition_set :
126- continue
125+ if partition_set is not None :
126+ spec_id = entry .data_file .spec_id
127+ partition = entry .data_file .partition
128+ if spec_id not in partition_set or partition not in partition_set [spec_id ]:
129+ continue
127130
128131 yield entry
129132
0 commit comments