rusackas opened a new pull request, #40618: URL: https://github.com/apache/superset/pull/40618
### SUMMARY This is a **test-only PR** opened as a TDD-style validation of issue #33554. #33554 reports that SQL Lab queries against Presto return a raw pyhive error — `presto error: Unexpected status code 401 b'Unauthorized'` — instead of a user-readable message. Datasets and charts work fine with the same connection; the 401 surfaces only in SQL Lab. **Root cause gap:** `PrestoEngineSpec.custom_errors` handles `"Access Denied: Invalid credentials"` (the pyhive LDAP-auth path) but has no pattern for `"Unexpected status code 401"` (the HTTP-401 path pyhive takes when the Presto server rejects the initial request). Trino's engine spec has explicit `needs_oauth2` / error handling for HTTP 401; Presto's does not. This PR adds one test to `tests/unit_tests/db_engine_specs/test_presto.py`: **`test_extract_errors_maps_401_to_access_denied`** — calls `extract_errors` with the exact pyhive 401 message and asserts `CONNECTION_ACCESS_DENIED_ERROR`. **Fails today** (no matching regex in `custom_errors`). ### How to interpret CI - **CI red** → the 401 message is not mapped; add `r"Unexpected status code 401"` to `custom_errors` (or a `needs_oauth2`-style handler) in `superset/db_engine_specs/presto.py`. - **CI green** → 401 errors are handled; merging closes #33554 and guards the mapping. ### TESTING INSTRUCTIONS ```bash pytest tests/unit_tests/db_engine_specs/test_presto.py::test_extract_errors_maps_401_to_access_denied -v ``` ### ADDITIONAL INFORMATION - [x] Has associated issue: closes #33554 - [ ] Required feature flags: N/A - [ ] Changes UI: No - [ ] Includes DB Migration: No - [ ] Introduces new feature or API: No 🤖 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]
