twuebi commented on code in PR #679:
URL: https://github.com/apache/iceberg-go/pull/679#discussion_r2698434161
##########
table/transaction.go:
##########
@@ -275,7 +275,10 @@ func (t *Transaction) ExpireSnapshots(opts
...ExpireSnapshotsOpt) error {
}
}
- updates = append(updates, NewRemoveSnapshotsUpdate(snapsToDelete))
+ // Only add the update if there are actually snapshots to delete
+ if len(snapsToDelete) > 0 {
+ updates = append(updates,
NewRemoveSnapshotsUpdate(snapsToDelete))
+ }
return t.apply(updates, reqs)
Review Comment:
We should probably also have a length check on `updates` and simply return
`nil` if `len(updates) == 0`
--
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]