This is an automated email from the ASF dual-hosted git repository.

aminghadersohi pushed a commit to branch work-pr-39604
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 40cf92399ceb860fc7a6c0d21bc50ea31a97473a
Author: Amin Ghadersohi <[email protected]>
AuthorDate: Fri May 22 02:13:39 2026 +0000

    fix(mcp): broaden _log_user_resolution_failure type hint
    
    mypy correctly flags that the caller can pass either ValueError or
    PermissionError; widen the type hint to match.
---
 superset/mcp_service/auth.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/superset/mcp_service/auth.py b/superset/mcp_service/auth.py
index c9686c39834..a75e9a83c90 100644
--- a/superset/mcp_service/auth.py
+++ b/superset/mcp_service/auth.py
@@ -519,14 +519,14 @@ def check_chart_data_access(chart: Any) -> 
"DatasetValidationResult":
     return validate_chart_dataset(chart, check_access=True)
 
 
-def _log_user_resolution_failure(exc: ValueError) -> None:
-    """Log a user-resolution ValueError at the appropriate level.
+def _log_user_resolution_failure(exc: ValueError | PermissionError) -> None:
+    """Log a user-resolution failure at the appropriate level.
 
     "No authenticated user found" is expected in unauthenticated/dev
     deployments (no JWT, no API key, no MCP_DEV_USERNAME configured) and
     during tools/list scanning — log at DEBUG to avoid ERROR noise.
-    All other ValueErrors (e.g. dev username not in DB) are genuine
-    credential failures and are logged at ERROR.
+    All other failures (e.g. dev username not in DB, permission denied) are
+    genuine credential failures and are logged at ERROR.
     """
     if "No authenticated user found" in str(exc):
         logger.debug("MCP: no auth source configured, unauthenticated request")

Reply via email to