fix(examples): correct chart metadata - #43810
Conversation
Code Review Agent Run #c724cfActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The flagged issue is correct. The current implementation in To resolve this, you should validate that the Here is a suggested fix for if (
formData.viz_type &&
echartsTimeseriesVizTypes.has(formData.viz_type) &&
!('x_axis' in formData) &&
formData.granularity &&
!formData.granularity.startsWith('P') // Exclude time grains like P1D
) {
formData.x_axis = formData.granularity;
}There are no other comments on this PR to address. superset-frontend/src/explore/store.ts |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43810 +/- ##
==========================================
+ Coverage 79.36% 79.39% +0.02%
==========================================
Files 2893 2893
Lines 167614 167740 +126
Branches 38816 38825 +9
==========================================
+ Hits 133026 133169 +143
+ Misses 32088 32071 -17
Partials 2500 2500
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
90c39fd to
6b27674
Compare
6b27674 to
c9aeeb0
Compare
There was a problem hiding this comment.
Code Review Agent Run #4cf9c8
Actionable Suggestions - 1
-
tests/unit_tests/examples/utils_test.py - 1
- Test checks wrong key · Line 232-232
Review Details
-
Files reviewed - 10 · Commit Range:
c9aeeb0..c9aeeb0- superset/examples/birth_names.py
- superset/examples/featured_charts/datasets/project_management.yaml
- superset/examples/usa_births_names/charts/Genders_by_State.yaml
- superset/examples/usa_births_names/charts/Top_10_Boy_Name_Share.yaml
- superset/examples/usa_births_names/charts/Top_10_Girl_Name_Share.yaml
- superset/examples/usa_births_names/charts/Trends.yaml
- superset/examples/world_bank.py
- superset/examples/world_health/charts/Growth_Rate.yaml
- superset/examples/world_health/charts/World_s_Pop_Growth.yaml
- tests/unit_tests/examples/utils_test.py
-
Files skipped - 0
-
Tools
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers an incremental AI Review. -
/review full- Manually triggers a full AI Review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
Code Review Agent Run #1f82efActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Corrects stale bundled example metadata for ECharts time-series charts that were storing the temporal column in legacy
granularity/granularity_sqlametadata instead ofx_axis.This updates the affected USA birth names, World Bank, Sales Dashboard, Slack Dashboard, and Video Game Sales chart YAML files. It also updates the Python example definitions that generate the same metadata, with separate
non_echarts_defaultsandecharts_x_axis_defaultsso the intended metadata shape is clear at each call site.This also fixes the stale
x_axis_formatypo tox_axis_time_formatfor the Top 10 name share examples.I also fixed the Featured Charts Gantt dataset metadata by clearing its
catalog; it was the only bundled example dataset withcatalog: examples, which makes PostgreSQL try to query a catalog/database namedexamples.I checked the migration path before keeping this as an examples-only fix. Persisted charts that go through the legacy viz migration are already covered by
superset/migrations/shared/migrate_viz/base.py, which mapsgranularity_sqlatox_axisfor migrated charts with an x-axis control. A later migration,2023-07-18_15-30_863adcf72773_delete_obsolete_druid_nosql_slice_parameters.py, also removes obsoletegranularitykeys from saved slice params and query contexts. If we find production ECharts metadata with this exact stale shape, we can add a runtime shim separately.BEFORE
See Trends and Top 10 Girls Names charts rendering incorrectly:
The Gantt chart dataset reference is incorrect, causing a query error:
AFTER
Trends and Top 10 Girls Names charts now render correctly:
Gantt also renders correctly:
TESTING INSTRUCTIONS
pytest tests/unit_tests/examples/utils_test.py -qvenv/bin/python -m compileall -q superset/examples/birth_names.py superset/examples/world_bank.py tests/unit_tests/examples/utils_test.pypre-commit runADDITIONAL INFORMATION