aminghadersohi commented on code in PR #39922:
URL: https://github.com/apache/superset/pull/39922#discussion_r3314808077
##########
tests/unit_tests/mcp_service/chart/validation/test_runtime_validator.py:
##########
@@ -226,28 +220,15 @@ def test_validate_table_chart_skips_xy_validations(self):
],
)
- # These should not be called for table charts
- with (
- patch(
-
"superset.mcp_service.chart.validation.runtime.RuntimeValidator."
- "_validate_format_compatibility"
- ) as mock_format,
- patch(
-
"superset.mcp_service.chart.validation.runtime.RuntimeValidator."
- "_validate_cardinality"
- ) as mock_cardinality,
- patch(
-
"superset.mcp_service.chart.validation.runtime.RuntimeValidator."
- "_validate_chart_type"
- ) as mock_chart_type,
- ):
- # Mock chart type validator to return no warnings
+ # Plugin runtime dispatches to TableChartPlugin which returns no
warnings.
+ # Chart type suggester is also stubbed to return no warnings.
+ with patch(
+ "superset.mcp_service.chart.validation.runtime.RuntimeValidator."
+ "_validate_chart_type"
+ ) as mock_chart_type:
mock_chart_type.return_value = ([], [])
is_valid, error = RuntimeValidator.validate_runtime_issues(config,
1)
- # Format and cardinality validation should not be called for table
charts
- mock_format.assert_not_called()
- mock_cardinality.assert_not_called()
assert is_valid is True
assert error is None
Review Comment:
Not a regression — the test still correctly verifies the skip behavior. With
the registry refactor, `FormatTypeValidator` and `CardinalityValidator` are
only invoked from `XYChartPlugin.get_runtime_warnings()`, which the registry
dispatches only for `chart_type='xy'`. For `table`,
`TableChartPlugin.get_runtime_warnings()` returns `[]` directly. The behavioral
assertion (`is_valid=True, error=None`) verifies the skip without coupling the
test to internal dispatch implementation details.
--
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]