diff --git a/metricflow/plan_conversion/node_processor.py b/metricflow/plan_conversion/node_processor.py index ac66c35737..1b94e4ceac 100644 --- a/metricflow/plan_conversion/node_processor.py +++ b/metricflow/plan_conversion/node_processor.py @@ -85,7 +85,6 @@ def __init__( # noqa: D self._semantic_model_lookup = semantic_model_lookup self._join_evaluator = SemanticModelJoinEvaluator(semantic_model_lookup) - # TODO: add test with time constraint def add_time_range_constraint( self, source_nodes: Sequence[BaseOutput], diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 1e1827b613..0192bed0e9 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -230,7 +230,6 @@ def _validate_no_time_dimension_query(self, metric_references: Sequence[MetricRe "dimension 'metric_time'." ) - # TODO: write tests for invalid linkable specs - should error def _validate_linkable_specs_for_metrics( self, metric_references: Tuple[MetricReference, ...], @@ -302,6 +301,9 @@ def _construct_metric_specs_for_query( def _get_metric_names( self, metric_names: Optional[Sequence[str]], metrics: Optional[Sequence[MetricQueryParameter]] ) -> Sequence[str]: + if not (metric_names or metrics): + return [] + assert_exactly_one_arg_set(metric_names=metric_names, metrics=metrics) return metric_names if metric_names else [m.name for m in metrics] if metrics else [] diff --git a/metricflow/test/query/test_query_parser.py b/metricflow/test/query/test_query_parser.py index 51f272879c..481e25ca1e 100644 --- a/metricflow/test/query/test_query_parser.py +++ b/metricflow/test/query/test_query_parser.py @@ -191,6 +191,9 @@ def test_query_parser(bookings_query_parser: MetricFlowQueryParser) -> None: # ), ) + with pytest.raises(UnableToSatisfyQueryError): + bookings_query_parser.parse_and_validate_query(group_by_names=["random_stuff"]) + def test_query_parser_with_object_params(bookings_query_parser: MetricFlowQueryParser) -> None: # noqa: D Metric = namedtuple("Metric", ["name", "descending"])