bito-code-review[bot] commented on code in PR #40955:
URL: https://github.com/apache/superset/pull/40955#discussion_r3553568046
##########
superset/commands/chart/exceptions.py:
##########
@@ -103,6 +103,19 @@ def __init__(self) -> None:
)
+class ChartQueryContextDatasourceMismatchValidationError(ValidationError):
+ """
+ Raised when a query-context-only update carries a datasource that does not
+ match the chart's own datasource.
+ """
+
+ def __init__(self) -> None:
+ super().__init__(
+ _("The query context datasource does not match the chart
datasource"),
+ field_name="query_context",
+ )
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing test coverage for validation</b></div>
<div id="fix">
The new `ChartQueryContextDatasourceMismatchValidationError` exception class
(lines 106-116) lacks test coverage. No tests were found for
`_validate_query_context_datasource` validation in the test suite. Tests should
cover: (1) mismatched datasource ID, (2) mismatched datasource type, (3) both
ID and type mismatched, and (4) the bypass path when no datasource is present
in query_context. Per BITO.md adaptive rule [11730], new functionality requires
comprehensive unit tests covering success paths, error scenarios, validation
failures, and edge cases.
</div>
</div>
<small><i>Code Review Run #b4ad73</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]