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


##########
superset/mcp_service/utils/schema_utils.py:
##########
@@ -383,6 +383,24 @@ def validator(cls: Type[BaseModel], v: Any, info: Any = 
None) -> List[BaseModel]
     return validator
 
 
+def _is_parse_request_enabled() -> bool:
+    """Check if parse_request decorator is enabled via config."""
+    try:
+        from flask import current_app, has_app_context
+
+        if has_app_context():
+            return current_app.config.get("MCP_PARSE_REQUEST_ENABLED", True)
+    except (ImportError, RuntimeError):
+        pass
+    try:
+        from superset.mcp_service.flask_singleton import app as flask_app
+
+        return flask_app.config.get("MCP_PARSE_REQUEST_ENABLED", True)

Review Comment:
   Claude commenting on Amin's behalf:
   
   Addressed in a5343c8 — switched from `.get()` with a default to direct key 
access (`config["MCP_PARSE_REQUEST_ENABLED"]`) and wrapped the return in 
`bool()` to handle non-boolean config values (e.g. string `"False"` from 
env-based configs). Also added `KeyError` to the exception handlers as a 
fallback.



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