alexandrusoare opened a new pull request, #40063:
URL: https://github.com/apache/superset/pull/40063

   ### SUMMARY
   
   `get_chart_preview` builds queries using hardcoded form_data keys 
(`metrics`, `groupby`) that don't match what certain chart types actually 
store. This caused three chart types to return incomplete or collapsed data.
   
   **Issue 1: Pie chart — metric column missing**
   
   - **Root cause:** Pie charts store their metric under `metric` (singular), 
but the query builder only reads `metrics` (plural). The metric was never 
included in the query.
   - **Fix:** New `_build_query_metrics()` helper checks both `metric` and 
`metrics` keys.
   
   **Issue 2: Pivot table — collapses to a single summary row**
   
   - **Root cause:** Pivot tables store dimensions under `groupbyRows` and 
`groupbyColumns`, but the query builder only reads `groupby` (which is empty 
for pivots). With no groupby columns, the query returns a single aggregated row.
   - **Fix:** `_build_query_columns()` now falls back to 
`groupbyRows`/`groupbyColumns` when `groupby` is absent.
   
   **Issue 3: Mixed timeseries — only primary y-axis data shown**
   
   - **Root cause:** Mixed timeseries charts store the secondary axis under 
`metrics_b` and `groupby_b`. The query builder only read `metrics` and 
`groupby`, so the second axis was invisible.
   - **Fix:** `_build_query_metrics()` merges `metrics_b` into the result. 
`_build_query_columns()` merges `groupby_b`.
   
   **Issue 4: Handlebars — no indication that raw data is shown**
   
   - **Root cause:** Handlebars charts render via browser-side templates, so 
MCP can only show the raw underlying data. There was no hint about this.
   - **Fix:** `chart_description` now includes a note explaining that the 
preview shows raw data, not the rendered template.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] 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
   - [ ] 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]

Reply via email to