Ferdinanddb opened a new pull request, #3900:
URL: https://github.com/apache/iceberg-python/pull/3900
Adds `ManageSnapshots.fast_forward_branch`, following Java's
`ManageSnapshots.fastForwardBranch` and Spark's `system.fast_forward` procedure.
```python
with table.manage_snapshots() as ms:
ms.fast_forward_branch("main", "audit")
```
- the ref to fast-forward to can be a branch or a tag and is left untouched
- a branch that does not exist yet is created at that snapshot with default
retention properties, an existing branch keeps its retention properties
- fast-forwarding to the snapshot the branch already points to is a no-op, a
branch that is not an ancestor raises `ValueError`
- operations chained in one `manage_snapshots()` see each other, and a ref
set twice in a chain results in a single `set-snapshot-ref` update
Supersedes #3649 by @JeroenSchmidt, which has been conflicting since August.
It keeps the same API and intra-chain behaviour and addresses the open review
comments from @rambleraptor (refs injected directly in the tests, default
retention of a created branch documented, tag target and no-op covered, shorter
docs). Differences: plain `ValueError` instead of new exception classes, the
pending refs come from `update_table_metadata` instead of a separate overlay,
and chained updates on the same ref are collapsed.
The second commit is separable: it adds the `gt=0` bounds that `SnapshotRef`
already has to `SetSnapshotRefUpdate`, so an invalid retention value fails when
it is passed instead of at apply time, like `SnapshotRef.Builder` in Java.
Happy to split it out if preferred.
--
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]