aminghadersohi commented on code in PR #45360:
URL: https://github.com/apache/superset/pull/45360#discussion_r4289364520


##########
superset/mcp_service/chart/tool/get_chart_data.py:
##########
@@ -1202,11 +1209,15 @@ async def _get_chart_data(  # noqa: C901
             # dedicated outer handlers return the OAuth redirect message
             # instead of a generic DataError.
             raise
-        except QueryObjectValidationError as ex:
+        except (QueryObjectValidationError, SemanticLayerQueryRejectedError) 
as ex:

Review Comment:
   `QueryObjectValidationError` from the semantic mapper never reaches this 
branch: query_context_processor.py:334 swallows it and `run()` then raises 
`ChartDataQueryFailedError` (a `CommandException`), so it lands in `DataError`.



##########
UPDATING.md:
##########
@@ -338,6 +338,13 @@ Connector/C this also verifies the server hostname, so the 
switch needs
 host. A Doris FE on its default self-signed certificate fails to connect once
 the switch is on.
 
+### MCP get_chart_data error categories
+
+`get_chart_data` returns `AccessDenied` when a query is refused for access, and
+`ValidationError` when a semantic layer provider rejects the query, matching 
the
+chart-data API's 403 and 400. Both were previously reported as `DataError`.
+Clients that matched on `DataError` for these cases should handle the new 
types.

Review Comment:
   Nit: On the saved-chart path these categories no longer emit the error-level 
MCP notification the `DataError` branch sent via `ctx.error`. A client keyed on 
that notification silently stops seeing refusals.
   
   ```suggestion
   Clients that matched on `DataError` for these cases should handle the new 
types.
   On the saved-chart path these errors also no longer emit an error-level MCP 
log
   notification; the category is carried by the response envelope alone.
   ```



-- 
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