Bug description
I came up with D3_FORMAT for my project in 3.1.1 version in config.py
D3_FORMAT = { "decimal": ",", "thousands": " ", "grouping": [3], "currency": ["$", ""] }
I added the following format and it worked
then I upgraded to 4.1 and it is also present in config.py superset-config.py and D3FormatConfig.ts files but it did not work
Screenshots/recordings
No response
Superset version
4.1.3
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Your D3_FORMAT config structure is still supported in Superset 4.1.3, and the backend/frontend pipeline for passing it hasn't fundamentally changed. The most common cause for custom D3_FORMAT not being applied after an upgrade is that superset_config.py isn't being loaded—this can happen if it's not in your PYTHONPATH, has a syntax error, or isn't picked up at runtime.
To debug:
1. Use browser devtools to inspect window.bootstrap_data.common.d3_format
(or window.bootstrap_data
if nested) on any Superset page. If your custom format isn't there, Superset isn't loading your config.
2. If it's missing, check that superset_config.py is in the correct location and free of errors. You can also run superset shell
and check from superset import conf; print(conf.get("D3_FORMAT"))
to confirm it's loaded.
3. If your config is present in the frontend but not applied, clear your browser cache and restart all Superset services to ensure no stale assets are used.
4. Recent changes in number formatting (especially for table charts) mean that if a metric's currency config is {}
(empty object), D3 formatting will now be applied as expected, but if you have a non-empty currency config, it may override your D3_FORMAT for that metric. See PR #34127 for details.
If you still have issues, check Superset logs for config or serialization errors, and consider sharing the relevant logs or your bootstrap data snippet for further diagnosis.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: msyavuz
If your config is present in the frontend but not applied, clear your browser cache and restart all Superset services to ensure no stale assets are used.
This seems like a possible solution to me. Have you tried any of these @mujohiddin?