From c7e23ed4ad3557612299c736257409cefa2528ed Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 13 Aug 2024 10:11:18 -0700 Subject: [PATCH] Handle TODO - validate min_max_only isn't used for metric queries --- .../metricflow_semantics/query/query_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metricflow-semantics/metricflow_semantics/query/query_parser.py b/metricflow-semantics/metricflow_semantics/query/query_parser.py index e8db500bad..6613f69761 100644 --- a/metricflow-semantics/metricflow_semantics/query/query_parser.py +++ b/metricflow-semantics/metricflow_semantics/query/query_parser.py @@ -344,7 +344,8 @@ def _parse_and_validate_query( order_by: Optional[Sequence[OrderByQueryParameter]], min_max_only: bool, ) -> ParseQueryResult: - # TODO: validate min_max_only - can only be called for non-metric queries + if min_max_only and (metric_names or metrics): + raise InvalidQueryException("Cannot use min_max_only param for queries with metrics.") assert_at_most_one_arg_set(metric_names=metric_names, metrics=metrics) assert_at_most_one_arg_set(group_by_names=group_by_names, group_by=group_by) assert_at_most_one_arg_set(order_by_names=order_by_names, order_by=order_by)