update
AssertCreate
¶
Bases: ValidatableTableRequirement
The table must not already exist; used for create transactions.
Source code in pyiceberg/table/update/__init__.py
AssertCurrentSchemaId
¶
Bases: ValidatableTableRequirement
The table's current schema id must match the requirement's current-schema-id
.
Source code in pyiceberg/table/update/__init__.py
AssertDefaultSortOrderId
¶
Bases: ValidatableTableRequirement
The table's default sort order id must match the requirement's default-sort-order-id
.
Source code in pyiceberg/table/update/__init__.py
AssertDefaultSpecId
¶
Bases: ValidatableTableRequirement
The table's default spec id must match the requirement's default-spec-id
.
Source code in pyiceberg/table/update/__init__.py
AssertLastAssignedFieldId
¶
Bases: ValidatableTableRequirement
The table's last assigned column id must match the requirement's last-assigned-field-id
.
Source code in pyiceberg/table/update/__init__.py
AssertLastAssignedPartitionId
¶
Bases: ValidatableTableRequirement
The table's last assigned partition id must match the requirement's last-assigned-partition-id
.
Source code in pyiceberg/table/update/__init__.py
AssertRefSnapshotId
¶
Bases: ValidatableTableRequirement
The table branch or tag identified by the requirement's ref
must reference the requirement's snapshot-id
.
if snapshot-id
is null
or missing, the ref must not already exist.
Source code in pyiceberg/table/update/__init__.py
AssertTableUUID
¶
Bases: ValidatableTableRequirement
The table UUID must match the requirement's uuid
.
Source code in pyiceberg/table/update/__init__.py
UpdateTableMetadata
¶
Bases: ABC
, Generic[U]
Source code in pyiceberg/table/update/__init__.py
__enter__()
¶
ValidatableTableRequirement
¶
Bases: IcebergBaseModel
Source code in pyiceberg/table/update/__init__.py
validate(base_metadata)
abstractmethod
¶
Validate the requirement against the base metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_metadata
|
Optional[TableMetadata]
|
The base metadata to be validated against. |
required |
Raises:
Type | Description |
---|---|
CommitFailedException
|
When the requirement is not met. |
Source code in pyiceberg/table/update/__init__.py
update_table_metadata(base_metadata, updates, enforce_validation=False, metadata_location=None)
¶
Update the table metadata with the given updates in one transaction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_metadata
|
TableMetadata
|
The base metadata to be updated. |
required |
updates
|
Tuple[TableUpdate, ...]
|
The updates in one transaction. |
required |
enforce_validation
|
bool
|
Whether to trigger validation after applying the updates. |
False
|
metadata_location
|
Optional[str]
|
Current metadata location of the table |
None
|
Returns:
Type | Description |
---|---|
TableMetadata
|
The metadata with the updates applied. |