aminghadersohi commented on code in PR #38890:
URL: https://github.com/apache/superset/pull/38890#discussion_r3006765779
##########
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:
Updated in 643614c7f2 — narrowed to `except (CommandException,
SQLAlchemyError, KeyError, ValueError)` with top-level imports.
##########
tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_generation.py:
##########
@@ -59,7 +59,7 @@ def mock_auth():
yield mock_get_user
[email protected](autouse=True)
[email protected]()(autouse=True)
Review Comment:
The actual issue was `@pytest.fixture()` needing to be `@pytest.fixture`
(ruff PT001), not `@pytest.fixture()(autouse=True)`. Fixed along with 19 PT023
errors (`@pytest.mark.asyncio()` → `@pytest.mark.asyncio`) in 643614c7f2.
##########
superset/mcp_service/chart/tool/generate_chart.py:
##########
@@ -807,6 +807,9 @@ async def generate_chart( # noqa: C901
return GenerateChartResponse.model_validate(result)
except (CommandException, SQLAlchemyError, KeyError, ValueError) as e:
+ from superset import db
+
+ db.session.rollback()
Review Comment:
This file is no longer in scope for this PR — the session/rollback changes
were split into #38934. The protected rollback pattern is addressed there.
--
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]