mikebridge opened a new pull request, #45828:
URL: https://github.com/apache/superset/pull/45828
### SUMMARY
**TL;DR:** MCP chart tools can now save charts and build Explore links on
versioned semantic views.
**Background:** Semantic views that version their member identifiers (for
example, table-qualified Snowflake names such as `O.TOTAL_REVENUE`) expose a
`semantic_selection_version`. Explore saves it with a chart's form data and
sends it in each query's extras, and the query layer refuses selections whose
version is missing or old, so a chart saved under an older naming scheme can't
silently resolve to the wrong member.
**Problem:** `generate_chart` and `generate_explore_link` built
semantic-view form data without the version, so every new MCP chart on a
versioned view looked like an old chart and was refused ("Saved semantic
selections use an older identity format…"). The MCP query builder also dropped
a top-level version instead of forwarding it to query extras. Separately, an XY
chart with a categorical semantic x-axis was first mapped as temporal, which
ignored the requested sort and produced a false "x-axis is temporal" warning.
**What this changes:**
- New selections from `generate_chart` and `generate_explore_link` are
stamped with the view's current selection version.
- The MCP query builder forwards that version to every query's extras,
mirroring the frontend: selections that include unverified external filters or
controls are still marked unverified, so they keep failing closed.
- The XY mapping for semantic views is rebuilt with the view's real temporal
columns before sort and warning decisions.
- `update_chart` is unchanged: rename, add-columns and config updates on
existing charts don't receive a new version, because they can retain selections
from the saved chart. Safely re-stamping existing charts needs a separate
full-reselection rule.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable: MCP request and payload changes only.
### TESTING INSTRUCTIONS
1. With a versioned semantic view, call `generate_chart` with `view_id`,
current metric and dimension IDs and `save_chart=true` (for example a bar chart
of a revenue metric by a segment dimension). It saves, and the saved params
carry `semantic_selection_version`.
2. Call `generate_explore_link` for the same view: the form data carries the
version and the chart renders.
3. Confirm a categorical x-axis keeps the requested sort with no temporal
warning.
Automated: MCP chart and Explore tool tests, including generation, Explore
links, query extras for every query, wrong/old/absent provenance, and
existing-chart updates staying unstamped.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
No migration, provider-version or frontend change.
--
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]