mikebridge opened a new pull request, #45525: URL: https://github.com/apache/superset/pull/45525
### SUMMARY Report rejected asynchronous chart queries as failed instead of completed successfully. **Background:** Chart queries can run in background workers. The worker publishes a cache key when results are ready, and the client then reads those results. **What users saw:** A semantic-view query with an invalid date filter could be reported as successful even though validation had rejected it. The client then repeated the rejected query synchronously to obtain the error. **Why:** The query processor preserves runtime validation failures in a typed error payload, but the ordinary worker returned normally without checking that marker. **What this changes:** - Fail the task when its payload contains a typed query validation refusal. - Preserve the synchronous error text and the worker exception's 400 classification. - Do not publish a cache key for that failed query. - Preserve successful queries and ordinary SQL engine structured-error readback. - Apply the existing guest-message policy when chart-task properties are read, using the viewer's identity rather than the worker's. The detailed design follows: the worker recognizes the existing `QueryObjectValidationMessage` before cache publication and lets the existing scheduler failure path record the result. Task polling still returns HTTP 200 with failure state and sanitized error text; this does not change the polling API's HTTP status. Follow-up to #45360. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF No visual layout change. Before: the worker returned normally and the scheduler recorded success. After: the scheduler records failure and the existing client failure path avoids synchronous result readback. ### TESTING INSTRUCTIONS Run: ```bash TZ=UTC python -m pytest tests/unit_tests/semantic_layers tests/unit_tests/tasks -q ``` The regression tests were observed failing before the production change: ordinary worker did not raise; the real scheduler recorded `success` rather than `failure`. After merging master, the focused directories plus the native MCP inventory regression pass (2,462 tests). They cover ordinary and totals workers, validation error text/status, no cache-key publication, and the unchanged success and ordinary SQL error paths. Detail-response and list-serialization tests check messages for guest and authenticated viewers without changing stored task properties. The DATE test uses Snowflake-shaped provider metadata through the real host mapper and processor; it is not a live Snowflake integration test. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [x] Required feature flags: existing semantic-layer and asynchronous chart execution configuration; no new flag. - [ ] 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 -- 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]
