rdblue commented on code in PR #5672:
URL: https://github.com/apache/iceberg/pull/5672#discussion_r963088103
##########
python/pyiceberg/table/metadata.py:
##########
@@ -128,13 +138,13 @@ def construct_refs(cls, data: Dict[str, Any]):
schemas: List[Schema] = Field(default_factory=list)
"""A list of schemas, stored as objects with schema-id."""
- current_schema_id: int = Field(alias="current-schema-id",
default=DEFAULT_SCHEMA_ID)
+ current_schema_id: int = Field(alias="current-schema-id",
default=INITIAL_SCHEMA_ID)
Review Comment:
I think that defaulting the ID when creating a new schema, spec, or order is
fine. But I don't think it is a good idea to default it here. At this point, we
no longer have users constructing metadata by hand and we want to make sure
that we're setting the ID correctly. If we re-create a schema for a new table
metadata object, then we should also set the current schema ID to that schema's
ID rather than relying on the same default in two places. That way if we ever
change the default assignment we don't break tables.
--
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]