aminghadersohi commented on code in PR #38641: URL: https://github.com/apache/superset/pull/38641#discussion_r2943377267
########## superset-core/src/superset_core/mcp/decorators.py: ########## @@ -37,6 +37,13 @@ def another_tool(value: int) -> str: from typing import Any, Callable, TypeVar +try: + from mcp.types import ToolAnnotations +except ( + ImportError +): # MCP extras may not be installed in superset-core-only environments + ToolAnnotations = Any Review Comment: Fixed in commit 3d27a32 — changed the fallback from `Any` to `dict` in both `superset-core/src/superset_core/mcp/decorators.py` and `superset/core/mcp/core_mcp_injection.py`. `dict(...)` is callable with keyword args, so `ToolAnnotations(readOnlyHint=True)` will work correctly even when `mcp.types` is not installed. -- 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]
