| commit | b0880c855b8dfd5c03019afcc5dd67a26432ce23 | [log] [tgz] |
|---|---|---|
| author | geruh <imgeru@gmail.com> | Mon Jan 12 09:01:32 2026 -0800 |
| committer | GitHub <noreply@github.com> | Mon Jan 12 09:01:32 2026 -0800 |
| tree | 40fd34d6638b8d641e166d877ffc922adefa8c1e | |
| parent | ce31fc95bb50d8714e97643c93dad82769e52934 [diff] |
feat: Add Set Current Snapshot to ManageSnapshots API (#2871)
# Rationale for this change
This PR adds the ability to change the set the current snapshot of a
table. A bulk of this work was done in #758 but instead we have broken
it out to focus on the set snapshot logic first. Additionally I added a
few more tests, following the existing expire snapshots behavior.
## Are these changes tested?
Yes, added tests
## Are there any user-facing changes?
New API :)
```
table.manage_snapshots().set_current_snapshot(snapshot_id=123456789).commit()
table.manage_snapshots().set_current_snapshot(ref_name="my-tag").commit()
# chaining
table.manage_snapshots() \
.create_tag(snapshot_id=older_id, tag_name="my-tag") \
.set_current_snapshot(ref_name="my-tag") \
.commit()
```
---------
Co-authored-by: Chinmay Bhat <12948588+chinmay-bhat@users.noreply.github.com>PyIceberg is a Python library for programmatic access to Iceberg table metadata as well as to table data in Iceberg format. It is a Python implementation of the Iceberg table spec.
The documentation is available at https://py.iceberg.apache.org/.