SEPURI-SAI-KRISHNA commented on issue #45017:
URL: https://github.com/apache/superset/issues/45017#issuecomment-6030276316

   Recording a residual case that @EnxDev raised in review on #45018, so it is 
not lost.
   
   A rename whose target already exists in `base_df` but is not itself in the 
mapping still produces a duplicate label:
   
   ```python
   base_df = DataFrame({"y": [1, 2], "z": [3, 4]})
   append_df = DataFrame({"y": [10, 20]})
   _append_columns(base_df, append_df, {"y": "z"})
   #    y  z   z
   # 0  1  3  10
   # 1  2  4  20
   ```
   
   Both #45018 and the current code key the overwrite/append split on whether 
the source and target names match. That is why this slips through: `y != z` 
sends the pair down the append path even though `z` is already there.
   
   Keying the split on whether the target is already in `base_df.columns` would 
cover it, and it subsumes the identity case, since a `{"y": "y"}` target is 
present by definition. That makes it a change to the helper's contract rather 
than a different fix, so it belongs in a follow-up instead of #45018.
   


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