bito-code-review[bot] commented on code in PR #40955:
URL: https://github.com/apache/superset/pull/40955#discussion_r3557663066
##########
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:
<!-- Bito Reply -->
The reviewer's suggestion regarding missing test coverage for the validation
logic is valid. While you have implemented tests for mismatched datasource IDs
and types, the current test suite does not explicitly cover the scenario where
a `datasource` object is provided in the `query_context` but is missing the
`type` field. Adding a test case for this specific edge case will ensure the
validation logic correctly rejects such payloads, preventing potential runtime
errors during dashboard loading.
--
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]