aminghadersohi opened a new pull request, #43771: URL: https://github.com/apache/superset/pull/43771
### SUMMARY Adds complete typed MCP support for the frontend ECharts Sunburst plugin using the exact `sunburst_v2` viz tag and the typed `chart_type="sunburst"` discriminator. - Registers a typed Sunburst plugin/schema with hierarchy, saved/SIMPLE/SQL primary and secondary metrics, filters/time controls, ordering/limits, and presentation controls. - Canonicalizes dataset columns and saved metrics case-insensitively, validates hierarchy/metric roles and output-label uniqueness, and round-trips native saved form data. - Rebuilds Sunburst query contexts faithfully for compile, `get_chart_data`, saved previews, and unsaved previews, including the frontend-only `sort_by_metric` transform and secondary metric promotion. - Gives `generate_chart`, `update_chart`, and `update_chart_preview` parity while preserving omitted saved UI/filter state and honoring explicit false/null/empty values. - Adds schema discovery, tool guidance, recommendation metadata, ASCII hierarchy previews, and product-path/regression coverage. Shortcut: [SC-119162](https://app.shortcut.com/preset/story/119162) Agor worktree: [sc-119162-mcp-sunburst](https://agor.sandbox.preset.zone/ui/w/01a05dae50f0741f888abd48/) Coordination: this is independent of the open typed [Bullet PR #43770](https://github.com/apache/superset/pull/43770) and community chart-plugin PRs such as [Sankey #43573](https://github.com/apache/superset/pull/43573), although those PRs touch the same registry/schema/docs surfaces and may require normal rebase sequencing. The merged generic fallback work in [#37969](https://github.com/apache/superset/pull/37969) did not provide typed Sunburst support. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable; this is MCP backend/schema/query support with no frontend UI change. ### TESTING INSTRUCTIONS ```bash # SQLAlchemy 2.0.52 compatible environment python -m pytest -q tests/unit_tests/mcp_service/chart/test_sunburst_chart.py \ tests/unit_tests/common/test_form_data_query_context.py \ tests/unit_tests/common/test_query_context_factory.py python -m pytest -q tests/unit_tests/mcp_service/chart python -m pytest -q tests/unit_tests/mcp_service pre-commit run --from-ref origin/master --to-ref HEAD ``` The focused/query-context run passes 109 tests, the full MCP chart run passes 1,391 tests, the broader MCP run passes 3,725 tests, and all pre-commit hooks pass under SQLAlchemy 2.0.52. Manual MCP verification when a server is available: 1. Call `get_chart_type_schema(chart_type="sunburst")` and confirm `viz_type` is fixed to `sunburst_v2`. 2. Generate a preview with a two-level hierarchy, primary metric, and optional secondary metric; inspect the Explore URL/query for both metrics, all hierarchy columns, and primary-metric descending order when requested. 3. Update the preview and saved chart while omitting presentation/filter fields, then repeat with explicit `false`, `null`, and `[]` values. The branch environment did not expose a live server on `localhost:8088`; the automated app/unit suites above were used instead. ### ADDITIONAL INFORMATION - [x] Has associated issue: [Shortcut SC-119162](https://app.shortcut.com/preset/story/119162) - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [x] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
