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

feat: Implement support for currencies in more charts #24594

Merged
merged 9 commits into from
Jul 7, 2023

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jul 5, 2023

SUMMARY

Continuation of #24517.
Implements support for currencies in WorldMap, Heatmap, Sunburst and Mixed Chart.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Follow the instructions from #24517, verify that the feature works in listed viz types.

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

@john-bodley
Copy link
Member

@kgabryje out of interest how many more chart types (on the roadmap) needs migrating? We're trying to grok the size of the problem.

Additionally do you perceive this and future changes as "breaking"? Asking because @michael-s-molina is working on Superset 3.0 and technically the breaking change window has closed.

@kgabryje
Copy link
Member Author

kgabryje commented Jul 7, 2023

@kgabryje out of interest how many more chart types (on the roadmap) needs migrating? We're trying to grok the size of the problem.

We don't plan on implementing the feature in any more charts for now.

Additionally do you perceive this and future changes as "breaking"? Asking because @michael-s-molina is working on Superset 3.0 and technically the breaking change window has closed.

All charts except for Table and Pivot Table were ignoring d3 format specified in dataset for saved metrics. This and the previous PR implemented that behaviour in the charts that now support currencies while mimicking the behaviour of Pivot Table, where the d3format of saved metric had higher priority than the d3format selected in control panel - which means that existing charts might be affected if they used saved metrics with custom d3formats.

However, we ( @rusackas, @eschutho, @yousoph) reached consensus to invert that behaviour - d3formats from control panel will have higher priority than d3formats from dataset, in order to avoid making this feature a breaking change.

@michael-s-molina
Copy link
Member

However, we ( @rusackas, @eschutho, @yousoph) reached consensus to invert that behaviour - d3formats from control panel will have higher priority than d3formats from dataset, in order to avoid making this feature a breaking change.

I think this is the correct approach. Thinking about hierarchy, if I define something at the control level, it should override the global dataset configuration. One thing we could do to make this smoother (if that's not the case already) is to set the default value of the control as the one defined at the dataset level, so that the user needs to explicitly change its value.

@kgabryje kgabryje requested review from eschutho and yousoph July 7, 2023 11:56
@kgabryje
Copy link
Member Author

kgabryje commented Jul 7, 2023

One thing we could do to make this smoother (if that's not the case already) is to set the default value of the control as the one defined at the dataset level, so that the user needs to explicitly change its value.

That wouldn't work for charts that allow more than 1 metric. Currently, the default value of format control is SMART_NUMBER, and even when you clear the select control, the value is still SMART_NUMBER instead of undefined.
The possible way to fix that is to introduce a new default value - "Dataset format", which would take d3 format from dataset and fall back to SMART_NUMBER.

@kgabryje
Copy link
Member Author

kgabryje commented Jul 7, 2023

The change that inverts the logic of d3 formats priority is this 1 line: https://github.com/apache/superset/pull/24594/files#diff-26b2a28ccbda108f227332667d56d83a9dd53448f1e27223cfd08c3914677a0fR38

Please keep in mind that now the custom d3 formats from datasets will remain broken in all charts except for Table until we implement the feature mentioned in post above. CC @michael-s-molina @john-bodley

@rusackas rusackas requested a review from john-bodley July 7, 2023 16:39
Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

LGTM

@yousoph
Copy link
Member

yousoph commented Jul 7, 2023

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

@yousoph Ephemeral environment spinning up at http://35.88.68.229:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@kgabryje kgabryje merged commit d74d7ec into apache:master Jul 7, 2023
26 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

Ephemeral environment shutdown and build artifacts deleted.

@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 7, 2023
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jul 7, 2023
@sadpandajoe
Copy link
Member

🏷️ preset:2023.27

michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
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 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants