rusackas opened a new pull request, #41964: URL: https://github.com/apache/superset/pull/41964
### SUMMARY Test-only regression for #30510. When a dataset has no real temporal column, a user can mistakenly check "Is Temporal" on a column, pick it as the "Default Datetime" (`main_dttm_col`), and save. Later un-checking "Is Temporal" clears the column's `is_dttm` flag, but `main_dttm_col` is never cleared. Because `SqlaTable.dttm_cols` always appends `main_dttm_col`, the now non-temporal column keeps being reported as a datetime column — so every chart on the dataset gets a default time filter on a column that isn't temporal, and there is no way to remove it short of recreating the dataset. This PR adds a single unit test that walks that exact sequence (mark temporal + set `main_dttm_col` → save → un-mark temporal → save) and asserts the desired end state: a column whose `is_dttm` is `False` must not appear in `dttm_cols`. No production code is changed. ### How to interpret CI - The new test `test_dttm_cols_excludes_column_after_temporal_flag_removed` is expected to **FAIL (red)** on master — that failure is the bug reproduction. It demonstrates that `dttm_cols` still returns the stale non-temporal column because `main_dttm_col` is not cleared. - A follow-up fix (clearing `main_dttm_col` when its column is no longer temporal, per the issue's suggested fix) would turn this test green. ### TESTING INSTRUCTIONS ```bash pytest tests/unit_tests/connectors/sqla/models_test.py::test_dttm_cols_excludes_column_after_temporal_flag_removed -v ``` Observe the assertion that `"not_really_a_date" not in dataset.dttm_cols` fails on master. ### ADDITIONAL INFORMATION - [ ] Has associated issue: Closes #30510 - [x] Required feature flags: n/a - [x] Changes UI: no - [x] Includes DB Migration: no - [x] Introduces new feature or API: no - [x] Removes existing feature or API: no 🤖 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]
