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

   ### SUMMARY
   
   Big Number charts generated through MCP now select the dataset's first 
temporal column when no main datetime column is configured. This matches 
Explore's temporal-column defaulting behavior and ensures the generated 
`TEMPORAL_RANGE` adhoc filter has a column to bind to.
   
   ### WHY
   
   The existing MCP fallback only considered `main_dttm_col`. Datasets can 
expose valid `is_dttm` columns without designating a main datetime column; 
Explore falls back to the first such column, while MCP emitted neither 
`granularity_sqla` nor a temporal adhoc filter. The fallback remains guarded by 
the existing backend temporal validation and leaves form data unchanged when 
the dataset has no valid temporal columns.
   
   ### BLAST RADIUS
   
   Limited to MCP-generated Big Number form data when `temporal_column` is 
omitted. There are no database, authorization, RLS, workspace-isolation, or 
frontend changes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable: this changes backend form-data serialization only. The 
user-visible result is that dashboard Time Range native filters affect the 
generated chart.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest -q tests/unit_tests/mcp_service/chart/test_big_number_chart.py 
tests/unit_tests/mcp_service/chart/test_chart_utils.py
   # 213 passed
   
   ruff format --check superset/mcp_service/chart/chart_utils.py 
superset/mcp_service/chart/schemas.py 
tests/unit_tests/mcp_service/chart/test_big_number_chart.py
   ruff check superset/mcp_service/chart/chart_utils.py 
superset/mcp_service/chart/schemas.py 
tests/unit_tests/mcp_service/chart/test_big_number_chart.py
   uvx pre-commit run --files superset/mcp_service/chart/chart_utils.py 
superset/mcp_service/chart/schemas.py 
tests/unit_tests/mcp_service/chart/test_big_number_chart.py
   ```
   
   The regression test constructs a dataset with `main_dttm_col=None` and an 
`is_dttm` column, then verifies the generated form data includes a 
`TEMPORAL_RANGE` filter bound to that column. The pre-commit changed-files run 
passes. A repository-wide pre-commit run was also attempted; it is blocked by 
pre-existing mypy failures and missing frontend dependencies in the local 
environment.
   
   ### RISK & ROLLBACK
   
   Low risk. Selection order matches Explore: configured main datetime column 
first, followed by temporal dataset columns. Reverting this commit restores the 
previous behavior. No migration or configuration rollback is required.
   
   ### REVIEW GUIDANCE
   
   Start with `_resolve_big_number_temporal_column`, then review the regression 
test covering a dataset without `main_dttm_col`. The key behavior is that only 
columns marked temporal are considered and each candidate still passes the 
existing temporal-type guard.
   
   ### EVAL EVIDENCE
   
   The deterministic chart-mapping unit suite passes 213/213. The full remote 
agent eval suite was not run because this draft has not been deployed to a 
staging workspace; no prompt, model, routing, or tool contract changed.
   
   ### COST & LATENCY DELTA
   
   No model or prompt changes. The fallback reuses the single dataset object 
already loaded and performs only an in-memory scan of its columns, so token 
cost is unchanged and no additional database request is introduced.
   
   ### PROMPT / NON-DETERMINISM
   
   Not applicable. No prompts, model parameters, tool schemas, or 
non-deterministic behavior changed.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated tests
   - [ ] Required feature flags
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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