aminghadersohi commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4121421723
##########
tests/unit_tests/mcp_service/chart/test_histogram_boxplot_charts.py:
##########
@@ -463,3 +463,65 @@ def
test_whisker_options_alongside_whisker_type_is_consumed(self) -> None:
}
)
assert config.whisker_type == "min_max"
+
+
[email protected](
+ ("adhoc_filters", "expected_metrics"),
+ [
+ ([], []),
+ (
+ [
+ {
+ "expressionType": "SQL",
+ "clause": "HAVING",
+ "sqlExpression": "COUNT(*) > 1",
+ }
+ ],
+ [
+ {
+ "expressionType": "SQL",
+ "sqlExpression": "COUNT(*)",
+ "label": "COUNT(*)",
+ }
+ ],
+ ),
+ ],
+)
+def test_histogram_query_matches_frontend_build_query(
+ adhoc_filters: list[dict[str, str]], expected_metrics: list[dict[str, str]]
+) -> None:
+ """Histogram queries select the binned column and apply
histogramOperator."""
+ from unittest.mock import patch
+
+ from superset.mcp_service.chart import chart_helpers
Review Comment:
Fixed in 5bfb99d033: moved patch and chart_helpers imports to module scope
and switched to the string-target patch for resolve_datasource_engine. The
existing parametrized histogram query regression tests cover both empty filters
and SQL HAVING filters.
--
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]