lawofcycles commented on code in PR #3320:
URL: https://github.com/apache/iceberg-python/pull/3320#discussion_r3448483904
##########
pyiceberg/table/update/snapshot.py:
##########
@@ -91,19 +96,35 @@ def _new_manifest_list_file_name(snapshot_id: int, attempt:
int, commit_uuid: uu
return f"snap-{snapshot_id}-{attempt}-{commit_uuid}.avro"
+@dataclass
+class CommitWindow:
Review Comment:
Done. Refactored `CommitWindow` to a frozen dataclass holding `base:
Snapshot | None` and `head: Snapshot | None` directly. Added
`CommitWindow.resolve(metadata, base_id, branch)` that handles snapshot
resolution and validation in one place, and `is_empty()` for skipping
validation when no concurrent commits occurred. Removed
`_resolve_catalog_head_snapshot()` and `_resolve_starting_snapshot()` from the
producer since CommitWindow now owns that logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]