twuebi commented on code in PR #671:
URL: https://github.com/apache/iceberg-go/pull/671#discussion_r2675579898
##########
table/transaction.go:
##########
@@ -241,7 +241,9 @@ func (t *Transaction) ExpireSnapshots(opts
...ExpireSnapshotsOpt) error {
for {
snap, err := t.meta.SnapshotByID(snapId)
if err != nil {
- return err
+ // Parent snapshot may have been removed by a
previous expiration.
+ // Treat missing parent as end of chain - this
is expected behavior.
+ break
Review Comment:
probably goes beyond the scope of this PR, if the only reason for
SnapshotByID to ever error is not found, then it should probably become a `ptr,
bool` or simply just `ptr` interface.
Relying on the function to only return an err for not found means that we
rely on something that's not statically checked, although unlikely, someone may
change `SnapshotByID` to return err on other cases too, and we'd treat that as
happy path here.
--
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]