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

   ### SUMMARY
   
   Adds a distinct, feature-gated MCP adapter for Preset's 
`ag-grid-pivot-table` visualization. This deliberately does **not** alias 
Interactive Pivot to the OSS `pivot_table_v2` adapter.
   
   The new `interactive_pivot` schema and plugin cover:
   
   - AG Grid row groups, pivot columns, metrics, metric aggregation, 
totals/subtotals, formats, filters, sorting, and cell/series limits
   - persisted `pivot_table_state` for the Rows, Column Labels, and Values 
side-panel buckets
   - comparison period/type mapping through `time_compare` and `comparison_type`
   - schema discovery and examples, generated names, capabilities/semantics, 
and tabular chart-data handling
   - update/preview preservation of UI-managed AG Grid state while replacing 
declarative grouping and aggregation state
   - fail-closed availability through Preset's `AG_GRID_PIVOT_TABLE_ENABLED` 
feature flag plus the existing MCP plugin filter, so OSS-only deployments do 
not advertise an unavailable visualization
   
   This implements [SC-113786](https://app.shortcut.com/preset/story/113786) 
and records the true AG Grid pivot as distinct from the OSS Pivot Table V2 
delivered under SC-100129.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable. This changes MCP schemas and form-data generation; it does 
not add or modify UI components.
   
   ### TESTING INSTRUCTIONS
   
   1. Enable `AG_GRID_PIVOT_TABLE_ENABLED` on a host that registers Preset's 
Interactive Pivot plugin.
   2. Call `get_chart_type_schema("interactive_pivot")` and verify the schema 
and examples are returned.
   3. Generate an Interactive Pivot with rows, columns, metrics, totals, and a 
comparison period/type; verify the Explore URL uses 
`viz_type=ag-grid-pivot-table` and its persisted grid state populates the AG 
Grid side-panel buckets.
   4. Update an existing Interactive Pivot and verify its concrete viz type 
remains `ag-grid-pivot-table` and UI-managed grid state such as 
sizing/filter/sort state is retained.
   5. Disable the feature flag and verify schema discovery and generation 
return `DISABLED_CHART_TYPE` rather than offering a broken chart.
   
   Automated validation run:
   
   ```bash
   PYTHONPATH="$PWD/superset-core/src:$PWD" pytest -q 
tests/unit_tests/mcp_service/chart
   # 1297 passed
   
   PYTHONPATH="$PWD/superset-core/src:$PWD" pytest -q \
     tests/unit_tests/mcp_service/chart/test_interactive_pivot_chart.py \
     tests/unit_tests/mcp_service/chart/tool/test_get_chart_type_schema.py \
     tests/unit_tests/mcp_service/chart/test_registry_filters.py
   # 58 passed
   
   pre-commit run --all-files
   # Passed
   
   pre-commit run
   # Passed
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: 
[SC-113786](https://app.shortcut.com/preset/story/113786)
   - [x] Required feature flags: `AG_GRID_PIVOT_TABLE_ENABLED`
   - [ ] 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
   
   #### AI behavior / evaluation evidence
   
   This is a deterministic schema, validation, and form-data mapping change. 
Unit tests cover schema examples, exact native viz resolution, feature-gated 
availability, validation, time-comparison mapping, side-panel state, 
update/preview preservation, capabilities, and generated naming. No model 
prompt, routing, retrieval, or sampling behavior changes.
   
   #### Cost and latency
   
   No additional model calls or network requests are introduced. Availability 
checks are in-process feature-flag lookups; chart mapping remains deterministic 
and local.
   


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