viirya opened a new pull request, #3580:
URL: https://github.com/apache/iceberg-rust/pull/3580

   ## Which issue does this PR close?
   
   - Closes #3579.
   
   ## What changes are included in this PR?
   
   `TableMetadataBuilder::remove_snapshots` now removes refs that point at a 
removed snapshot through `remove_ref` instead of a silent `retain`. Each 
dropped ref gets a `RemoveSnapshotRef` change, and dropping `main` clears 
`current_snapshot_id`. This matches Java's 
`TableMetadata.Builder.rewriteSnapshotsInternal`. Dangling ref names are sorted 
so the order of the recorded changes is deterministic.
   
   ## Are these changes tested?
   
   Yes, three unit tests in `table_metadata_builder.rs`: a branch and a tag on 
a removed snapshot, `main` on a removed snapshot, and refs on retained 
snapshots (no extra changes). The first two fail on main.
   
   ## AI Disclosure
   
   Written with an AI assistant (Claude). Please check that routing through 
`remove_ref` matches Java for `main`: Rust's `remove_ref` records 
`RemoveSnapshotRef` for `main` even when the ref is absent, which can't happen 
on this path since only existing refs are passed. Also check that the snapshot 
log handling after removing `main` (left to `update_snapshot_log`, as in Java) 
is what you expect.
   
   This pull request and its description were written by Isaac.
   


-- 
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]

Reply via email to