You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2024/11/01 12:25:13 UTC
Re: [PR] Remove `initial_change` when CreateTableTransaction apply table updates on an empty metadata [iceberg-python]
Fokko commented on code in PR #1219:
URL: https://github.com/apache/iceberg-python/pull/1219#discussion_r1825762462
##########
pyiceberg/table/update/__init__.py:
##########
@@ -90,7 +90,13 @@ class AddSchemaUpdate(IcebergBaseModel):
# This field is required: https://github.com/apache/iceberg/pull/7445
last_column_id: int = Field(alias="last-column-id")
- initial_change: bool = Field(default=False, exclude=True)
+ initial_change: bool = Field(
Review Comment:
It is clean to go through the validation cycle, but I would be surprised if anyone would be relying on these properties
##########
pyiceberg/table/update/__init__.py:
##########
@@ -267,11 +285,10 @@ def _(
elif update.format_version == base_metadata.format_version:
return base_metadata
- updated_metadata_data = copy(base_metadata.model_dump())
- updated_metadata_data["format-version"] = update.format_version
+ updated_metadata = base_metadata.model_copy(update={"format_version": update.format_version})
Review Comment:
Nice!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org