bsovran opened a new pull request, #36596:
URL: https://github.com/apache/superset/pull/36596
<!---
fix(async-queries): extract SIP-40 style errors in GAQ tasks
-->
### SUMMARY
This PR implements SIP-40 style error extraction for Global Async Queries
(GAQ) in the `load_chart_data_into_cache` task. Previously, all errors were
converted to simple strings with only a `message` field, losing rich error
information like `error_type`, `level`, and `extra` that is available in
`SupersetErrorException` and `SupersetErrorsException`.
The fix follows the existing pattern from `sql_lab.py` to properly extract
SIP-40 errors:
- Check if exception is `SupersetErrorException` and extract the `.error`
dataclass
- Check if exception is `SupersetErrorsException` and extract the `.errors`
list
- Fall back to current string-based handling for other exceptions (backward
compatible)
- Convert `SupersetError` dataclasses to dicts using `dataclasses.asdict()`
for JSON serialization
This ensures custom error messages with full context are properly propagated
to the frontend when using async queries.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - Backend change only
### TESTING INSTRUCTIONS
1. Run the unit tests:
pytest tests/unit_tests/tasks/test_async_queries.py -v
2. All 3 tests should pass:
- `test_load_chart_data_into_cache_with_error` - backward compatibility
- `test_load_chart_data_into_cache_with_superset_error_exception` -
SIP-40 single error
- `test_load_chart_data_into_cache_with_superset_errors_exception` -
SIP-40 multiple errors
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] 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
--
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]