HonahX commented on code in PR #498:
URL: https://github.com/apache/iceberg-python/pull/498#discussion_r1525833930
##########
pyiceberg/table/metadata.py:
##########
@@ -287,6 +287,31 @@ def _generate_snapshot_id() -> int:
return snapshot_id
+class IncompleteTableMetadata(TableMetadataCommonFields):
Review Comment:
Honestly, I also do not like this solution 😢 . I pushed this just because it
looks better than the `InitialTableMetadataConstructor` thing in my first
draft.
In general, we need a way to construct a base metadata without any schema,
spec, and sort-order so that we can construct a complete metadata via
traversing these [create
changes](https://github.com/apache/iceberg-python/pull/498/files#diff-23e8153e0fd497a9212215bd2067068f3b56fa071770c7ef326db3d3d03cee9bR388-R413).
Currently, we have some before validators that automatically adds schema
(construct_schemas) and spec (construct_partition_specs) to the metadata model.
This behavior conflicts with the required create changes: AddSchemaUpdate and
AddPartitionSpecUpdate.
(https://github.com/apache/iceberg-python/pull/498#discussion_r1513709599)
I am thinking a third approach that we may add a flag to `TableUpdate` to
mark it as `create changes` and let `_apply_table_update` handle these updates
specially. We will exclude this flag from serialization so RestCatalog is not
affected. If it can work, we do not need this additional class anymore.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]