Skip to content

Commit 5f1e0dc

Browse files
Reframe ReplaceTableTransaction.commit_transaction docstring
Per audit: clarify that we always emit AssertLastAssigned*Id, which is stricter than the reference contract that conditions them on Add* being present. Fail-safe vs corruption-risk.
1 parent a813a92 commit 5f1e0dc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pyiceberg/table/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,13 +1132,18 @@ def _find_matching_sort_order_id(table_metadata: TableMetadata, sort_order: Sort
11321132
def commit_transaction(self) -> Table:
11331133
"""Commit the replace changes to the catalog.
11341134
1135-
Requirements:
1135+
Always emits three optimistic-concurrency requirements:
11361136
- `AssertTableUUID` — the table identity hasn't changed since load.
11371137
- `AssertLastAssignedFieldId` — guards against a concurrent commit bumping
11381138
`last-column-id` between load and commit (which would cause our newly-assigned
11391139
field IDs to collide).
11401140
- `AssertLastAssignedPartitionId` — same guard for partition field IDs.
11411141
1142+
Note: this is deliberately stricter than the reference REST `forReplaceTable`
1143+
contract, which conditions the `AssertLastAssigned*Id` requirements on
1144+
`AddSchema` / `AddPartitionSpec` being present in the change set. Emitting them
1145+
unconditionally is fail-safe — a no-op replace just confirms the assertions hold.
1146+
11421147
Returns:
11431148
The table with the updates applied.
11441149
"""

0 commit comments

Comments
 (0)