We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
retain_last_n
1 parent 855e22a commit 29ae3a8Copy full SHA for 29ae3a8
pyiceberg/table/update/snapshot.py
@@ -1092,10 +1092,14 @@ def with_retention_policy(
1092
return self
1093
1094
def retain_last_n(self, n: int) -> ExpireSnapshots:
1095
- """Keep only the last N snapshots, expiring all others.
+ """Keep only the last N snapshots globally across all branches, expiring all others.
1096
+
1097
+ Note: This method considers snapshots globally across the entire table history,
1098
+ not per-branch. Protected snapshots (branch/tag heads) are always preserved
1099
+ regardless of the retention count.
1100
1101
Args:
- n: Number of most recent snapshots to keep.
1102
+ n: Number of most recent snapshots to keep globally.
1103
1104
Returns:
1105
This for method chaining.
0 commit comments