FrancescoCastaldi opened a new pull request, #45037:
URL: https://github.com/apache/superset/pull/45037
### SUMMARY
Fixes #45017.
When a post-processing columns mapping both renames and overwrites columns
(e.g. {'y': 'y', 'z': 'z2'}), _append_columns produced duplicated column labels
and leaked unmapped columns from append_df.
This change:
1. Separates the overwrite logic from the append logic in _append_columns by
delegating to _transfer_column.
2. Selectively transfers only explicitly mapped columns from append_df,
discarding unwanted extra columns.
3. Preserves base_df immutability via defensive copy and safely handles both
single-level and MultiIndex hierarchies.
### TESTING INSTRUCTIONS
Run the pandas postprocessing unit tests:
pytest tests/unit_tests/pandas_postprocessing/test_utils.py
All tests pass, confirming zero duplicate column labels and expected Series
return types.
### ADDITIONAL INFORMATION
- [x] Has associated issue: fixes #45017
- [x] Changes UI: No
- [x] Requires DB Migration: No
--
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]