gps23 opened a new pull request, #43921: URL: https://github.com/apache/superset/pull/43921
### SUMMARY Refreshing dataset columns from the source (`fetch_metadata` / "Refresh columns") mutated child `TableColumn` rows without writing any parent `tables` column, so SQLAlchemy never fired `changed_on` `onupdate`. Chart `query_cache_key()` includes `datasource.changed_on`, so a previously cached result computed against the old column type/expression could keep being served after a schema change. This force-bumps `SqlaTable.changed_on` when `fetch_metadata()` reports added, modified (type or physical expression), or dropped physical columns — the same cache-invalidation signal `DatasetDAO.update()` already applies on PUT `/dataset`. No-op refreshes and leftover calculated columns do not bump the timestamp. Fixes #43918. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A (backend cache-key invalidation) ### TESTING INSTRUCTIONS - [ ] `pytest tests/unit_tests/connectors/sqla/models_test.py -k fetch_metadata` - [ ] `pytest tests/integration_tests/datasets/api_tests.py -k test_dataset_item_refresh` - [ ] In the UI: change a physical column type in the source table, click **Refresh columns** on the dataset, then reload a chart that uses that column and confirm the result is not served from the pre-refresh cache. ### ADDITIONAL INFORMATION - [x] Has associated issue: #43918 - [ ] 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 - [ ] Introduces new feature or API - [ ] Removes existing feature or API Made with [Cursor](https://cursor.com) -- 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]
