aminghadersohi commented on code in PR #44462:
URL: https://github.com/apache/superset/pull/44462#discussion_r4057624532
##########
superset/mcp_service/dataset/tool/query_dataset.py:
##########
@@ -433,6 +433,17 @@ async def query_dataset( # noqa: C901
error_type="DatabaseError",
)
+ except ValueError as exc:
+ # Expected user/agent-input validation (e.g. a reversed time_range
where
+ # since > until raises "From date cannot be larger than to date" from
+ # date_parser.get_since_until). Return an actionable ValidationError
+ # without a full-traceback log — this is not a bug.
+ await ctx.error("Invalid request: %s" % (str(exc),))
Review Comment:
This `try` spans ~282 lines, including all of `execute_tabular_query`, so an
unanticipated `ValueError` (pydantic's subclasses it) reaches here too —
reported to the agent as its own `ValidationError`, with no traceback anywhere.
One line keeps those diagnosable:
```suggestion
logger.warning("Invalid request while querying dataset: %s", exc)
await ctx.error("Invalid request: %s" % (str(exc),))
```
--
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]