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

   ### SUMMARY
   
   Adds a **waterfall** chart type plugin to the MCP `generate_chart` registry 
(#39922), the third statistical/analytical addition in this series 
(delete/restore lifecycle: #41472 merged / #41842; histogram + box plot: 
#41860).
   
   Design notes — incorporating the review outcomes from #41860 up front:
   
   - **form_data verified against the frontend plugin source**, not assumed: 
`x_axis` (single step-per-value column, temporal-friendly), single-select 
`groupby` breakdown (the Waterfall controlPanel sets `multi: false` — the 
config field is a single `breakdown: ColumnRef` accordingly, not a list), 
single `metric`, and the display options (`show_total` default `true` per the 
controlPanel, increase/decrease/total labels matching `constants.ts`). 
`row_limit` defaults to the shared 10000.
   - **Native vocabulary accepted**: `groupby` is a validation alias for 
`breakdown`, per the codebase's translate-don't-refuse convention.
   - **Dimension fields reject metric-style refs** 
(`saved_metric`/`sql_expression` on `x_axis`/`breakdown`), consistent with the 
tightened validation in #41860.
   - **Preview classification included from the start**: `waterfall` maps into 
the bar-mark preview bucket (it is a bar construction), avoiding the 
misclassification gap found post-hoc on #41860.
   - Stale chart-type-count references were swept: the two remaining "7 chart 
types" comments in validator/utils docstrings were made count-agnostic so they 
can't rot again.
   - `get_chart_type_schema` gains the type with two examples; `generate_chart` 
docstring and server instructions updated.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (MCP service; no UI changes)
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest tests/unit_tests/mcp_service/chart/test_waterfall_chart.py  # 13 new 
tests
   pytest tests/unit_tests/mcp_service/chart/                          # full 
chart suite
   ```
   
   Manual: via an MCP client, `generate_chart` with
   `{"dataset_id": <id>, "config": {"chart_type": "waterfall", "x_axis": 
{"name": "<period_col>"}, "metric": {"name": "<value_col>", "aggregate": 
"SUM"}}}`
   returns a working preview; add `"breakdown": {"name": "<category_col>"}` for 
per-category steps.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] 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
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_014z1fQxTadTEvpCJLx9WnB8
   


-- 
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