Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chart): Resolve incorrect column customization when switching metrics in table chart #26393

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

soniagtm
Copy link
Contributor

@soniagtm soniagtm commented Jan 2, 2024

SUMMARY

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

Before: Currency prefix is switched to SUM(quantity_ordered)

Before.mov

After: Currency prefix is applied to SUM(sales) as expected

After.mov

TESTING INSTRUCTIONS

  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

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (29633e7) 69.14% compared to head (1c99138) 69.15%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26393      +/-   ##
==========================================
+ Coverage   69.14%   69.15%   +0.01%     
==========================================
  Files        1946     1946              
  Lines       75989    75991       +2     
  Branches     8479     8479              
==========================================
+ Hits        52544    52553       +9     
+ Misses      21266    21257       -9     
- Partials     2179     2181       +2     
Flag Coverage Δ
javascript 56.48% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Jan 2, 2024
@john-bodley
Copy link
Member

Thanks @soniagtm for the fix. Would you mind adding a unit test to ensure we don't regress in the future?

@pull-request-size pull-request-size bot added size/L and removed size/XS labels Jan 3, 2024
@soniagtm
Copy link
Contributor Author

soniagtm commented Jan 3, 2024

Hi, I've added test cases for switching metric columns and changing their names. I'm not sure if this is the correct way to do so. Please let me know if any corrections or further additions are needed.

Thank you in advance!

@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Jan 3, 2024
@john-bodley
Copy link
Member

@justinpark would you mind reviewing this?

Copy link
Member

@justinpark justinpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding test specs

@rusackas rusackas merged commit dfde2ad into apache:master Jan 4, 2024
30 checks passed
@michael-s-molina michael-s-molina added v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Jan 9, 2024
michael-s-molina pushed a commit that referenced this pull request Jan 9, 2024
…rics in table chart (#26393)

Co-authored-by: Sonia <sonia.gautam@agoda.com>
(cherry picked from commit dfde2ad)
michael-s-molina pushed a commit that referenced this pull request Jan 9, 2024
…rics in table chart (#26393)

Co-authored-by: Sonia <sonia.gautam@agoda.com>
(cherry picked from commit dfde2ad)
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
…rics in table chart (apache#26393)

Co-authored-by: Sonia <sonia.gautam@agoda.com>
(cherry picked from commit dfde2ad)
@mistercrunch mistercrunch added 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
…rics in table chart (apache#26393)

Co-authored-by: Sonia <sonia.gautam@agoda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🍒 3.1.2 🍒 3.1.3 🚢 4.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants