lawofcycles commented on code in PR #3320:
URL: https://github.com/apache/iceberg-python/pull/3320#discussion_r3361690702
##########
pyiceberg/table/update/snapshot.py:
##########
@@ -499,6 +549,62 @@ def files_affected(self) -> bool:
"""Indicate if any manifest-entries can be dropped."""
return len(self._deleted_entries()) > 0
+ def _refresh_for_retry(self) -> None:
+ """Reset state for a retry attempt, clearing the cached delete
computation."""
+ super()._refresh_for_retry()
+ # Clear @cached_property by removing it from the instance __dict__.
+ # _compute_deletes depends on _parent_snapshot_id which changes on
retry.
+ if "_compute_deletes" in self.__dict__:
+ del self.__dict__["_compute_deletes"]
+
+ def _validate_concurrency(self) -> None:
+ """Validate that concurrent changes do not conflict with this delete.
+
+ Note: This method is intentionally duplicated in _OverwriteFiles
rather than
+ extracted to the base class. While the logic is currently identical,
Java Iceberg's
+ BaseOverwriteFiles and BaseRowDelta have divergent validation. Keeping
them separate
+ makes it easier to add RowDelta-specific validation in the future.
Review Comment:
Fair point. Moved the implementation to `_SnapshotProducer` and added a
no-op override in `_FastAppendFiles`.
--
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]