Arunodoy18 opened a new pull request, #37593: URL: https://github.com/apache/superset/pull/37593
### SUMMARY Fixes failures in annotation layers when charts use time grain values such as P1D, P1M, etc. Previously, annotation query construction could incorrectly treat time grain values as physical dataset column names, leading to query failures such as: Column 'P1D' not found This change ensures time grain values are always resolved using existing time grain mapping logic and translated into SQL expressions, consistent with normal chart query generation. ### ROOT CAUSE Time grain values represent temporal grouping logic but were not always resolved through the standard time grain mapping utilities when building annotation queries. This could cause annotation queries to reference non-existent dataset columns. ### CHANGES - Reuse existing time grain resolution logic during annotation query construction - Prevent raw time grain values from being treated as dataset column references - Keep behavior unchanged when time grain is not used - No changes to datasource metadata, schema, or query interfaces ### TESTING INSTRUCTIONS Automated Tests: - Added tests ensuring annotation queries resolve time grain values correctly - Verified no regression for annotations without time grain - Verified dashboard + annotation workflows remain functional Manual Verification: 1. Create a chart with time grain (e.g. daily / monthly) 2. Add annotation layer 3. Confirm annotation renders correctly without missing column errors 4. Verify behavior remains correct when adding chart to dashboards ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #24374 - [ ] 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]
