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

   ### SUMMARY
   
   Semantic views had no way to say which temporal dimension Explore should 
default to. The host always set `main_dttm_col=None`, so Explore picked the 
first temporal column in whatever order the provider returned. For MetricFlow 
that is often an entity date such as `customer__first_ordered_at` rather than 
`metric_time`, and the choice changes when the dimension order changes.
   
   This adds an optional, typed `SemanticView.preferred_time_dimension` to the 
core SDK. The host projects it to `main_dttm_col` only when the name matches an 
exposed temporal dimension. When it is absent, unknown or not temporal, the 
existing fallback is unchanged. Saved charts keep their chosen temporal 
subject; nothing is migrated or rewritten.
   
   No end-to-end behaviour changes until a provider opts in. The MetricFlow 
opt-in (declaring `metric_time` when it is exposed) is a separate change.
   
   ### TESTING INSTRUCTIONS
   
   - Red first: host tests with entity-first dimensions plus a declared 
`metric_time` failed before the change (missing SDK field; 
`main_dttm_col=None`). New cases also cover absent, unknown and non-temporal 
declarations.
   - `pytest tests/unit_tests/semantic_layers superset-core/tests` (semantic 
suites): 703 passed. Existing `getTemporalColumns` Jest suite: 5 passed. 
Changed-file pre-commit hooks including MyPy pass.
   - Whole service-free unit suite at this commit: 21,575 passed; the 15 
failures match a known local machine-specific baseline and none are in files 
this branch touches.
   - Not yet verified live: with a provider that declares `metric_time`, a 
fresh Table chart should default to it, and a dashboard native time range 
should filter on it.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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