amogh-jahagirdar commented on code in PR #411:
URL: https://github.com/apache/iceberg-python/pull/411#discussion_r1485696929


##########
pyiceberg/table/metadata.py:
##########
@@ -313,6 +315,34 @@ def construct_partition_specs(cls, data: Dict[str, Any]) 
-> Dict[str, Any]:
 
         return data
 
+    @model_validator(mode="before")
+    def construct_v1_spec_from_v2_fields(cls, data: Dict[str, Any]) -> 
Dict[str, Any]:

Review Comment:
   Yeah it just felt a bit awkward to pass in the fields in a redundant way. As 
long as the source of truth is correct when reading the fields, which it is as 
you saw for `schemas` then we're good. I've updated.
   
   Also PartitionSpec on the V1 metadata is a list[dict[str, any]], right now I 
work with that to preserve compatibility but that does make things a bit 
awkward since we have to pass in the model_dump of partition spec instead of 
just the normal `PartitionSpec`. 



-- 
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

Reply via email to