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

   ### SUMMARY
   
   MCP chart configs only exposed a direct dashboard time-filter column for Big 
Number charts. Other chart plugins could generate form data without either 
`granularity_sqla` or a `TEMPORAL_RANGE` filter, leaving scoped dashboard time 
ranges without a subject column.
   
   This change:
   
   - adds a shared optional `temporal_column` field to every MCP chart 
configuration
   - centrally binds otherwise-unbound charts to the explicit temporal column, 
a valid temporal x-axis, or the dataset's `main_dttm_col`
   - preserves existing chart-specific granularity and temporal filters
   - includes the shared temporal column in dataset validation and case 
normalization
   - merges cached preview filters without replacing mapper-generated temporal 
bindings
   - documents how to select a non-default dashboard time-filter column
   
   The generated binding uses a neutral `TEMPORAL_RANGE` filter rather than 
setting `granularity_sqla` universally, avoiding changes to grouping and 
timeseries query semantics.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable; this changes MCP chart form-data generation without UI 
changes.
   
   ### TESTING INSTRUCTIONS
   
   Automated:
   
   ```bash
   pytest -q tests/unit_tests/mcp_service/chart
   pre-commit run --from-ref origin/master --to-ref HEAD
   ```
   
   Manual:
   
   1. Configure a dataset with a primary datetime column.
   2. Generate a Table, Pie, Pivot Table, categorical XY, Histogram, Box Plot, 
Handlebars, or Waterfall chart through MCP.
   3. Save the chart and add it to a dashboard in scope for a Time Range native 
filter.
   4. Change the dashboard time range and verify the chart query uses the 
dataset's primary datetime column.
   5. Repeat with `temporal_column` set to another temporal column and verify 
that column is used.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: 
[SC-115331](https://app.shortcut.com/preset/story/115331)
   - [ ] 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]

Reply via email to