bito-code-review[bot] commented on code in PR #40340:
URL: https://github.com/apache/superset/pull/40340#discussion_r3337059789


##########
superset/mcp_service/app.py:
##########
@@ -874,7 +880,7 @@ def init_fastmcp_server(
 
     # Remove disabled tools BEFORE generating instructions so that the
     # instructions never advertise tools that clients cannot actually call.
-    disabled_tools: set[str] = flask_app.config.get("MCP_DISABLED_TOOLS", 
set())
+    disabled_tools: set[str] = flask_app.config["MCP_DISABLED_TOOLS"]

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Test Compatibility: Change [] to .get()</b></div>
   <div id="fix">
   
   Same issue as line 873 — changing to `[]` breaks tests that mock 
`config.get.side_effect`. The test helper `_mock_flask_config()` only 
configures `.get()`, not `__getitem__`, causing MagicMock objects to flow 
through as `branding` instead of strings.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/mcp_service/app.py
    +++ b/superset/mcp_service/app.py
    @@ -883,7 +883,7 @@
         # Remove disabled tools BEFORE generating instructions so that the
         # instructions never advertise tools that clients cannot actually call.
    -    disabled_tools: set[str] = flask_app.config["MCP_DISABLED_TOOLS"]
    +    disabled_tools: set[str] = flask_app.config.get("MCP_DISABLED_TOOLS", 
set())
         _remove_disabled_tools(disabled_tools)
         config_guard_removed = _apply_config_guards(flask_app)
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #eb30ac</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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