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


##########
superset/mcp_service/dashboard/tool/add_chart_to_existing_dashboard.py:
##########
@@ -534,7 +509,7 @@ def add_chart_to_existing_dashboard(
             error=None,
         )
 
-    except (CommandException, SQLAlchemyError, KeyError, ValueError) as e:
+    except Exception as e:

Review Comment:
   <!-- Bito Reply -->
   The change addresses the overly broad exception handling by specifying 
relevant exceptions (CommandException, SQLAlchemyError, KeyError, ValueError), 
improving clarity and maintainability while matching the pattern in 
generate_chart.py.



##########
tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_generation.py:
##########
@@ -813,17 +809,15 @@ async def test_add_chart_to_tabbed_dashboard(
                 "DASHBOARD_VERSION_KEY": "v2",
             }
         )
+        mock_find_dashboard.return_value = mock_dashboard

Review Comment:
   <!-- Bito Reply -->
   The comments identify valid issues in the test file. The mock setup for 
DashboardDAO.find_by_id needs side_effect for tests expecting consecutive 
calls, and the fixture decorator change to @pytest.fixture()(autouse=True) is 
incorrect—it will cause a TypeError. Changes are needed to address these.



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