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

   ### SUMMARY
   
   When an async chart query fails, the chart currently shows only a generic 
failure message, even though the task already holds the real error. This change 
surfaces that error to the user.
   
   - `GET /api/v1/task/<uuid>/status` gains an optional `error_message`, 
returned only for terminal chart-query tasks (failed, aborted, or timed out). 
The existing `status` field is unchanged, so the contract is additive.
   - The message is sanitized with the same request-scoped policy that 
synchronous chart responses use, so embedded guests get the generic message and 
authenticated users get the stored text.
   - It is visible only to callers who can already see the task, since the 
lookup goes through the existing task access filter. The stack trace is never 
returned.
   - The frontend fetches this detail once per failed task and uses it for both 
the websocket and polling transports. If the lookup fails or the field is 
absent, the previous generic error is shown. Stale generations and duplicate 
terminal events do not settle another request.
   - The admin docs for async queries describe the new behavior.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (the change replaces the text of an existing error state).
   
   ### TESTING INSTRUCTIONS
   
   Run the focused backend API module 
`tests/integration_tests/tasks/api_tests.py` (32 tests pass) and the focused 
frontend middleware module 
`superset-frontend/src/middleware/asyncEvent.test.ts` (39 tests pass). They 
cover the terminal statuses, exclusion of non-chart tasks, the fallback when 
the detail is missing, and both transports. The six new frontend polling and 
websocket cases for failure, abort, and timeout were run before the 
implementation and failed on the original generic error. Changed-file 
pre-commit hooks pass.
   
   The broader `tests/unit_tests` run was interrupted locally under memory 
pressure before it finished, so no whole-suite result is claimed here. CI is 
the authority for the full suite. No live Celery worker or browser was 
exercised.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue
   - [x] Required feature flags (`GLOBAL_ASYNC_QUERIES`)
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [x] Introduces new feature or API (additive optional `error_message` on 
the task status response)
   - [ ] Removes existing feature or API
   
   Known follow-ups:
   
   - Add a real guest-token integration test for the redaction behavior.
   - Add tests for duplicate terminal events, re-initialization in the middle 
of a detail fetch, and a non-string `error_message`.
   
   🤖 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