soniagtm opened a new pull request, #26393: URL: https://github.com/apache/superset/pull/26393
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> I have found that when attempting to swap the positions of metrics in the table chart with applied column configuration, the column configuration is switched to another column, which is related to the addition of #19841 for maintaining configurations when metrics are renamed. To address this issue, I have added a condition to first check if the column name is found in the old metrics. If it is found, it will avoid updating the column configuration. Reassignment will only occur if the new column name is not found among the existing ones to maintain configurations when metrics are renamed. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> **Before:** Currency prefix is switched to SUM(quantity_ordered) https://github.com/apache/superset/assets/96282005/8f83aa5f-2794-4f9a-adfb-2085293dc0f2 **After:** Currency prefix is applied to SUM(sales) as expected https://github.com/apache/superset/assets/96282005/e17f0ed8-5dff-482e-9797-4edb0bcdf8d7 ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> 1. Create a table chart with dimensions and two or more metrics. 2. Apply number formatting to any of the metrics. 3. Attempt to swap the positions of the metrics. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
