Skip to content

Commit 167f9e4

Browse files
committed
remove a level of nesting with smarter clause
1 parent 74d5569 commit 167f9e4

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

pyiceberg/table/update/validate.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ def validation_history(
5454
for snapshot in ancestors_between(from_snapshot, to_snapshot, table.metadata):
5555
last_snapshot = snapshot
5656
summary = snapshot.summary
57-
if summary is None:
57+
if summary is None or summary.matching_operations not in matching_operations:
5858
continue
59-
if summary.operation in matching_operations:
60-
snapshots.add(snapshot)
61-
manifests_files.extend(
62-
[
63-
manifest
64-
for manifest in snapshot.manifests(table.io)
65-
if manifest.added_snapshot_id == snapshot.snapshot_id and manifest.content == manifest_content_filter
66-
]
67-
)
59+
60+
snapshots.add(snapshot)
61+
manifests_files.extend(
62+
[
63+
manifest
64+
for manifest in snapshot.manifests(table.io)
65+
if manifest.added_snapshot_id == snapshot.snapshot_id and manifest.content == manifest_content_filter
66+
]
67+
)
6868

6969
if last_snapshot is None or last_snapshot.snapshot_id == from_snapshot.snapshot_id:
7070
raise ValidationException("No matching snapshot found.")

0 commit comments

Comments
 (0)