-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Conversation
@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. |
We don't plan on implementing the feature in any more charts for now.
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. |
ad85447
to
212fff7
Compare
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. |
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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/testenv up |
@yousoph Ephemeral environment spinning up at http://35.88.68.229:8080. Credentials are |
Ephemeral environment shutdown and build artifacts deleted. |
(cherry picked from commit d74d7ec)
🏷️ preset:2023.27 |
(cherry picked from commit d74d7ec)
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