aminghadersohi opened a new pull request, #43770: URL: https://github.com/apache/superset/pull/43770
### SUMMARY Adds complete typed MCP support for the frontend ECharts Bullet plugin (`viz_type: bullet`). - Adds the exact `chart_type: bullet` discriminated-union member, plugin registry entry, schema discovery examples, tool guidance, and recommendation metadata. - Models the frontend `controlPanel` / `buildQuery` / `transformProps` contract, including SIMPLE, saved, and SQL metrics; grouped row hierarchies; filters/time controls; ordering/limits; and range, marker, label, legend, and number-format controls. - Adds dataset-aware exact/casefold normalization, ambiguity detection, role/output validation, and numeric-output constraints. - Uses the shared MCP query builder for Bullet's singular metric + groupby transformation and preserves frontend-only `orderby` semantics for compile/data paths. - Preserves omitted native Bullet query, filter, and presentation state across `update_chart` and `update_chart_preview`, while explicit empty/false/null values remain authoritative. - Adds layered horizontal ASCII/Vega-Lite preview support for saved and unsaved Bullet charts, including metric aliases, the complete dimension hierarchy, ranges, targets, and marker lines. - Adds product-path coverage through `generate_chart`, `update_chart`, `update_chart_preview`, compile/query builders, registry/schema discovery, dataset normalization, and preview paths; includes a non-Bullet regression guard. Tracking: [Shortcut SC-119157](https://app.shortcut.com/preset/story/119157) Agor worktree: [sc-119157-mcp-bullet](https://agor.sandbox.preset.zone/ui/w/01a05dad4b317188b2ac217d/) Deduplication/coordination: current master, open/merged Apache Superset PRs, contributor/community branches, and Agor review-zone work were checked before implementation. No existing Bullet MCP implementation was found. I also reviewed the newer chart-type MCP work (including #43737 and the community chart-type PR series #43567-#43573) to avoid overlapping implementations. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — this changes the MCP server contract/query/preview paths and does not modify the frontend Bullet plugin UI. A live Superset server was not available in this worktree, so no UI screenshot was captured. ### TESTING INSTRUCTIONS Run in a SQLAlchemy 2-compatible environment: ```bash export PYTHONPATH="$PWD/superset-core/src" # Bullet product paths python -m pytest -q tests/unit_tests/mcp_service/chart/test_bullet_chart.py # Full MCP chart suite python -m pytest -q tests/unit_tests/mcp_service/chart/ # Broader shared query-context coverage python -m pytest -q \ tests/unit_tests/common/test_form_data_query_context.py \ tests/unit_tests/common/test_query_context_factory.py \ tests/unit_tests/charts/data/form_data_test.py \ tests/unit_tests/charts/data/test_empty_query_context.py # Staged/range static checks pre-commit run --from-ref origin/master --to-ref HEAD ``` Results on this branch: - Bullet product paths: `23 passed` - Focused MCP schema/registry/query/tool paths: `560 passed` - Full MCP chart suite: `1389 passed` - Broader form-data/query-context paths: `87 passed` - Pre-commit, mypy, ruff/format, pylint, and repository hooks: passed Manual schema check: call `get_chart_type_schema` with `chart_type="bullet"`, then use its example with `generate_chart`; verify returned native form data has `viz_type="bullet"`, one `metric`, the complete `groupby`, and comma-separated range/marker controls. ### ADDITIONAL INFORMATION - [x] Has associated issue: [Shortcut SC-119157](https://app.shortcut.com/preset/story/119157) - [ ] 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]
