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

   ### SUMMARY
   
   **TL;DR:** Metric discovery reports an access refusal instead of showing a 
misleading empty or incomplete catalog.
   
   **Background.** MCP clients use `list_metrics` to find metrics across 
datasets and semantic views.
   
   **Problem.** If a semantic view refused discovery while loading metrics or 
compatible dimensions, the per-view fallback swallowed that refusal and 
reported a successful result. Clients could mistake missing metrics for an 
empty catalog.
   
   **What changes.** Typed security refusals reach the existing `AccessDenied` 
handler. If any visible view refuses discovery, an unscoped `list_metrics` call 
fails as a whole, including built-in dataset metrics; use `dataset_id` or 
`view_id` to scope the call to a source that does not refuse. Unexpected 
provider failures keep their warning and partial-result behavior. Tests cover 
scoped and unscoped discovery through streamable HTTP, plus refusal responses 
on both async chart-data HTTP paths. No SDK or `/compatible` behavior changes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable: MCP and HTTP response behavior.
   
   ### TESTING INSTRUCTIONS
   
   Run `pytest 
tests/unit_tests/mcp_service/semantic_layer/tool/test_list_metrics.py 
tests/unit_tests/semantic_layers/query_errors_test.py -q`.
   
   143 tests passed. Six discovery cases fail on the old code and pass with the 
fix. Both async HTTP cases fail when refusals are deliberately converted to 202 
responses; the production async implementation is unchanged. Changed-file hooks 
pass.
   
   HTTP tests use in-process transports and injected refusal exceptions. They 
do not require or validate a live provider, broker or worker.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [x] Required feature flags: `SEMANTIC_LAYERS` for semantic-view discovery
   - [ ] 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]

Reply via email to