Skip to content

Commit

Permalink
Add check query test for metric filter with local entity prefix in gr…
Browse files Browse the repository at this point in the history
…oup by
  • Loading branch information
courtneyholcomb committed May 8, 2024
1 parent 8f41c4d commit 3826db8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests_metricflow/integration/test_cases/itest_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2047,3 +2047,23 @@ integration_test:
) c ON a.listing_id = c.listing_id
) outer_subq
WHERE listing__bookings > 2 AND listing__bookers > 1
---
integration_test:
name: test_metric_filter_with_local_entity_prefix
description: Query with a metric filter, using a group by that has a local entity prefix
model: SIMPLE_MODEL
metrics: ["listings"]
where_filter: "{{ render_metric_template('views', ['view__listing']) }} > 2"
check_query: |
SELECT
SUM(1) AS listings
FROM {{ source_schema }}.dim_listings_latest l
LEFT OUTER JOIN (
SELECT
listing_id
, SUM(1) AS view__listing__views
FROM {{ source_schema }}.fct_views v
GROUP BY listing_id
) subq
ON l.listing_id = subq.listing_id
WHERE view__listing__views > 2

0 comments on commit 3826db8

Please sign in to comment.