porkedchop opened a new pull request, #4110:
URL: https://github.com/apache/iceberg-python/pull/4110

   # Rationale for this change
   
   `UpdateSpec._partition_field` only looks for an existing partition field to 
reuse when the table's format version is exactly 2. On a v3 table, adding back 
a partition field that was removed earlier gets a new field ID instead of the 
original one, and removing and re-adding the same field in one `update_spec()` 
fails with "Cannot add duplicate partition field name". Java's 
`BaseUpdatePartitionSpec` reuses fields for `formatVersion >= 2`, so this 
changes the check to match.
   
   ## Are these changes tested?
   
   Yes, added `test_update_spec_reuses_removed_partition_field_id`, run against 
both the v2 and v3 table fixtures. The v3 case fails without the change.
   
   ## Are there any user-facing changes?
   
   Partition evolution on v3 tables now reuses the original field ID when a 
removed partition field is added back, the same as v2.
   


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

Reply via email to