smaheshwar-pltr commented on code in PR #4520:
URL: https://github.com/apache/iceberg-python/pull/4520#discussion_r4740530451
##########
pyiceberg/table/__init__.py:
##########
@@ -1289,10 +1289,10 @@ def _attempt_landed(self) -> bool:
f"Commit failed and the table could not be refreshed to check
whether it landed: {e}"
) from e
+ # A commit adds all of its snapshots or none, so finding one is
enough. Another writer may have
+ # expired the others, since no ref points at a snapshot once another
is committed on top of it.
added_snapshot_ids = {update.snapshot.snapshot_id for update in
self._updates if isinstance(update, AddSnapshotUpdate)}
- return bool(added_snapshot_ids) and all(
- self._table.metadata.snapshot_by_id(snapshot_id) is not None for
snapshot_id in added_snapshot_ids
- )
+ return any(self._table.metadata.snapshot_by_id(snapshot_id) is not
None for snapshot_id in added_snapshot_ids)
Review Comment:
Thanks for the repro, it reproduces with zero and one retries. Fokko has
filed it as #4534, so let's continue there. I can't add labels, so I'll leave
`changelog` to a committer.
--
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]