anupam-saini commented on code in PR #433: URL: https://github.com/apache/iceberg-python/pull/433#discussion_r1527602013
########## pyiceberg/catalog/__init__.py: ########## @@ -710,6 +760,45 @@ def _get_updated_props_and_update_summary( return properties_update_summary, updated_properties + def _replace_table( + self, + identifier: Union[str, Identifier], + new_schema: Union[Schema, "pa.Schema"], + new_partition_spec: PartitionSpec, + new_sort_order: SortOrder, + new_properties: Properties, + new_location: Optional[str] = None, + ) -> Table: + table = self.load_table(identifier) + with table.transaction() as tx: + base_schema = table.schema() + new_schema = assign_fresh_schema_ids(schema_or_type=new_schema, base_schema=base_schema) Review Comment: Thanks @Fokko for this detailed explanation. But we also need to cover the step 2 of this example where we add a new schema, right? So from my understanding, if the schema fields match with an old schema in the metadata, we do `union_by_name` with the old schema and set it as the current one Else, we add the new schema. Is this correct assessment? -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org