Repository navigation
fix(mcp): auto-generate empty dashboard titles - #45799
aminghadersohi wants to merge 2 commits into
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45799 +/- ##
===========================================
+ Coverage 65.26% 84.56% +19.29%
===========================================
Files 3068 3068
Lines 204990 204988 -2
Branches 48174 48173 -1
===========================================
+ Hits 133788 173342 +39554
+ Misses 68154 28345 -39809
- Partials 3048 3301 +253
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:
|
|
Product acceptance at 51eb49a: ship. I ran the PR head and the merge base (e97d7ca) in a real Superset with Postgres and the MCP service, calling the tools over streamable HTTP through the default
One LOW finding, outside this diff and also present on the merge base. A blank name-only Not verified: natural-language prompts through a real LLM (I called the tools directly), and JWT auth (I used fixed-user dev mode). |
SUMMARY
Treat an empty
generate_dashboardtitle exactly like a whitespace-only or omitted title: normalize it toNone, then generate a descriptive title from the chart names. Remove the intentional-blank-title exception. Thedashboard_title,title, andnamealiases share the behavior.Update the schema description, tool docstring, user documentation, and regression coverage (including byte-string inputs).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No UI change. Before:
dashboard_title: ""persists an empty title. After: it persists the same chart-derived title as whitespace-only input.TESTING INSTRUCTIONS
Call
generate_dashboardwith an accessible chart and comparedashboard_title: ""," ", and an omitted title. All should save the same nonblank chart-derived title.Automated validation:
Result: 2211 passed.
Revert-fails: restored
superset/mcp_service/dashboard/schemas.pyfrom the base while retaining the regression tests, then ran the schema, generation, and sanitization-warning modules with-k 'blank_title_uses_auto_title or blank_title_auto_generated or blank_titles_normalize_before_length': 16 failed, 287 passed, 1731 deselected, exit 1. Failures cover empty strings through all three dashboard aliases, the saved title in the tool call, and string/bytes/bytearray normalization. Whitespace and sibling-tool checks still pass. Restored the implementation afterward: 303 passed, 1731 deselected, exit 0, with the same selection.Scoped
pre-commit run: passed, including mypy. Real-model tests were not run (manual/llm_complianceexcluded).Sibling search over
superset/mcp_service/(dashboard_title,chart_name,slice_name, blank/empty checks and name/title declarations):dashboard/schemas.pyanddashboard/tool/generate_dashboard.py: empty input uses the existing auto-title path; schema aliases and persisted title covered by regressions.dashboard/schemas.py,dashboard/tool/update_dashboard.py,dashboard/tool/duplicate_dashboard.py: already reject explicit empty/whitespace titles; omitted update titles leave the title unchanged.chart/schemas.py(ChartNameMixin): normalizes blankchart_name,name,title, andslice_namealiases toNone.chart/tool/generate_chart.pygenerates a name.chart/tool/update_chart.pyretains the existing name or generates one with config; a blank name-only update is rejected. Neither writes the supplied blank string.chart/tool/update_chart_preview.py: generates a preview name, not a caller-provided blank title.slice_name/title; they do not accept a rename or create a blank-named object. This change does not rewrite existing records.sql_lab/schemas.py: SQL Lab tab titles already strip blanks toNonefor the default naming path.ADDITIONAL INFORMATION