Skip to content

Commit

Permalink
Test metric filter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed May 13, 2024
1 parent 7de8f0b commit db4bd40
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,11 @@ def query_parser_from_yaml(yaml_contents: List[YamlConfigFile]) -> MetricFlowQue
return MetricFlowQueryParser(
semantic_manifest_lookup=semantic_manifest_lookup,
)


def test_invalid_group_by_metric(bookings_query_parser: MetricFlowQueryParser) -> None:
"""Tests that a query for an invalid group by metric gives an appropriate group by metric suggestion."""
with pytest.raises(InvalidQueryException, match="Metric\\('bookings', group_by=\\['listing'\\]\\)"):
bookings_query_parser.parse_and_validate_query(
metric_names=("bookings",), where_constraint_str="{{ Metric('listings', ['garbage']) }} > 1"
)

0 comments on commit db4bd40

Please sign in to comment.