Skip to content

Commit 29ae3a8

Browse files
committed
Fixed: doc string for retain_last_n to properly describe the function.
1 parent 855e22a commit 29ae3a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pyiceberg/table/update/snapshot.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,10 +1092,14 @@ def with_retention_policy(
10921092
return self
10931093

10941094
def retain_last_n(self, n: int) -> ExpireSnapshots:
1095-
"""Keep only the last N snapshots, expiring all others.
1095+
"""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.
10961100
10971101
Args:
1098-
n: Number of most recent snapshots to keep.
1102+
n: Number of most recent snapshots to keep globally.
10991103
11001104
Returns:
11011105
This for method chaining.

0 commit comments

Comments
 (0)