Repository navigation
fix(mcp): put metrics first in pie and treemap captions - #46127
Draft
aminghadersohi wants to merge 1 commit into
Draft
aminghadersohi wants to merge 1 commit into
aminghadersohi wants to merge 1 commit into
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #46127 +/- ##
=======================================
Coverage 65.35% 65.36%
=======================================
Files 3083 3083
Lines 211224 211224
Branches 49803 49803
=======================================
+ Hits 138054 138057 +3
+ Misses 69992 69990 -2
+ Partials 3178 3177 -1
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:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Put metrics before dimensions in MCP-generated pie/donut captions and default saved-chart names (
total_revenue by region). The sibling treemap builder had the same reversal and uses the same convention.Preserve metric-label precedence, filter context, explicit titles, and existing saved names. No stored chart names are migrated.
Siblings checked:
superset/mcp_service/chart/chart_utils.py:_pie_chart_whatand_treemap_chart_whatchanged;_xy_chart_whatand_gauge_chart_whatalready use metric-first ordering. Table, bubble, pivot table, mixed timeseries, handlebars, and big number builders use summary/comparison formats, not reversed metric-by-dimension text.superset/mcp_service/chart/plugins/pie.py: sole caller of_pie_chart_what; delegates throughgenerate_chart_name.superset/mcp_service/chart/plugins/: sunburst, waterfall, and box plot already put metrics first; other name builders use non-comparable formats.superset/mcp_service/chart/tool/generate_chart.py: default name flows intoCreateChartCommand.slice_nameand accessibilityalt_text; covered by saved pie/donut regression tests.superset/mcp_service/chart/tool/update_chart.pyandupdate_chart_preview.py: shared default-name consumers inherit the change; explicit/existing titles retain precedence.tests/unit_tests/mcp_service/chart/test_new_chart_types.py: updated both assertions pinning reversed pie names; added pie/donut metric-label/filter and treemap regressions. Repository search found no other_pie_chart_whatcallers or literal old-caption expectations. Chart plugin inventory tests do not pin this text.Searches:
rg -n 'def .*what|return f.* by ' superset/mcp_service/chart/chart_utils.py,rg -n '_pie_chart_what|product by revenue|product by Total Revenue|region by total_revenue' ., and plugingenerate_name/toolgenerate_chart_namesearches.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Text-only behavior:
Chart showing region by total_revenue; default saved nameregion by total_revenue.Chart showing total_revenue by region; default saved nametotal_revenue by region.TESTING INSTRUCTIONS
PYTHONPATH=$PWD/superset-core/src:$PWD pytest -q tests/unit_tests/mcp_service/chart -m 'not manual and not llm_compliance': 6805 passed, 3 skipped in 277.69s.git add <four touched files> && pre-commit run: all applicable hooks passed (including mypy, Ruff, and pylint); rerun after Ruff formatting.region, saved metrictotal_revenue, and no explicit title; check the caption and default saved name. Explicit titles should remain unchanged.ADDITIONAL INFORMATION