Copilot commented on code in PR #4365:
URL: https://github.com/apache/iceberg-python/pull/4365#discussion_r4573293567


##########
pyiceberg/table/update/schema.py:
##########
@@ -503,12 +503,14 @@ def update_column(
         return self
 
     def _find_for_move(self, name: str) -> int | None:
+        # A column added in this update shadows a deleted column with the same 
name
+        if (added_id := self._added_name_to_id.get(name)) is not None:
+            return added_id

Review Comment:
   The added-column lookup still ignores `case_sensitive=False`. Deleting `z`, 
adding its replacement as `Z`, and calling `move_after("z", "x")` resolves the 
deleted field ID and still raises `StopIteration` when applying the update; the 
same issue affects replacement columns used as before/after anchors. Match 
added names case-insensitively when that option is disabled, and add a 
regression case with different casing.



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