Skip to content

Commit

Permalink
Update funky test case (#1249)
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb authored Jun 6, 2024
1 parent 67e9c85 commit ef8cbac
Show file tree
Hide file tree
Showing 15 changed files with 204 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_metric_filtered_by_itself(
query_spec = query_parser.parse_and_validate_query(
metric_names=("bookers",),
where_constraint=PydanticWhereFilter(
where_sql_template="{{ Metric('bookers', ['guest']) }} > 1.00",
where_sql_template="{{ Metric('bookers', ['listing']) }} > 1.00",
),
).query_spec
dataflow_plan = dataflow_plan_builder.build_plan(query_spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ FROM (
FROM (
-- Constrain Output with WHERE
SELECT
subq_14.guest__bookers
subq_14.listing__bookers
, subq_14.bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_13.guest__bookers
subq_13.listing__bookers
, subq_13.bookers
FROM (
-- Join Standard Outputs
SELECT
subq_6.guest AS guest
, subq_12.guest__bookers AS guest__bookers
subq_6.listing AS listing
, subq_12.listing__bookers AS listing__bookers
, subq_6.bookers AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_5.guest
subq_5.listing
, subq_5.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -227,24 +227,24 @@ FROM (
) subq_5
) subq_6
LEFT OUTER JOIN (
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
subq_11.guest
, subq_11.guest__bookers
subq_11.listing
, subq_11.listing__bookers
FROM (
-- Compute Metrics via Expressions
SELECT
subq_10.guest
, subq_10.bookers AS guest__bookers
subq_10.listing
, subq_10.bookers AS listing__bookers
FROM (
-- Aggregate Measures
SELECT
subq_9.guest
subq_9.listing
, COUNT(DISTINCT subq_9.bookers) AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_8.guest
subq_8.listing
, subq_8.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -443,15 +443,15 @@ FROM (
) subq_8
) subq_9
GROUP BY
guest
listing
) subq_10
) subq_11
) subq_12
ON
subq_6.guest = subq_12.guest
subq_6.listing = subq_12.listing
) subq_13
) subq_14
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
) subq_15
) subq_16
) subq_17
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ SELECT
COUNT(DISTINCT bookers) AS bookers
FROM (
-- Join Standard Outputs
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_26.guest__bookers AS guest__bookers
subq_26.listing__bookers AS listing__bookers
, subq_20.bookers AS bookers
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
guest_id AS guest
listing_id AS listing
, guest_id AS bookers
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_20
LEFT OUTER JOIN (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
-- Aggregate Measures
-- Compute Metrics via Expressions
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
guest_id AS guest
, COUNT(DISTINCT guest_id) AS guest__bookers
listing_id AS listing
, COUNT(DISTINCT guest_id) AS listing__bookers
FROM ***************************.fct_bookings bookings_source_src_28000
GROUP BY
guest
listing
) subq_26
ON
subq_20.guest = subq_26.guest
subq_20.listing = subq_26.listing
) subq_28
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ FROM (
FROM (
-- Constrain Output with WHERE
SELECT
subq_14.guest__bookers
subq_14.listing__bookers
, subq_14.bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_13.guest__bookers
subq_13.listing__bookers
, subq_13.bookers
FROM (
-- Join Standard Outputs
SELECT
subq_6.guest AS guest
, subq_12.guest__bookers AS guest__bookers
subq_6.listing AS listing
, subq_12.listing__bookers AS listing__bookers
, subq_6.bookers AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_5.guest
subq_5.listing
, subq_5.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -227,24 +227,24 @@ FROM (
) subq_5
) subq_6
LEFT OUTER JOIN (
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
subq_11.guest
, subq_11.guest__bookers
subq_11.listing
, subq_11.listing__bookers
FROM (
-- Compute Metrics via Expressions
SELECT
subq_10.guest
, subq_10.bookers AS guest__bookers
subq_10.listing
, subq_10.bookers AS listing__bookers
FROM (
-- Aggregate Measures
SELECT
subq_9.guest
subq_9.listing
, COUNT(DISTINCT subq_9.bookers) AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_8.guest
subq_8.listing
, subq_8.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -443,15 +443,15 @@ FROM (
) subq_8
) subq_9
GROUP BY
subq_9.guest
subq_9.listing
) subq_10
) subq_11
) subq_12
ON
subq_6.guest = subq_12.guest
subq_6.listing = subq_12.listing
) subq_13
) subq_14
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
) subq_15
) subq_16
) subq_17
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ SELECT
COUNT(DISTINCT bookers) AS bookers
FROM (
-- Join Standard Outputs
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_26.guest__bookers AS guest__bookers
subq_26.listing__bookers AS listing__bookers
, subq_20.bookers AS bookers
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
guest_id AS guest
listing_id AS listing
, guest_id AS bookers
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_20
LEFT OUTER JOIN (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
-- Aggregate Measures
-- Compute Metrics via Expressions
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
guest_id AS guest
, COUNT(DISTINCT guest_id) AS guest__bookers
listing_id AS listing
, COUNT(DISTINCT guest_id) AS listing__bookers
FROM ***************************.fct_bookings bookings_source_src_28000
GROUP BY
guest_id
listing_id
) subq_26
ON
subq_20.guest = subq_26.guest
subq_20.listing = subq_26.listing
) subq_28
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ FROM (
FROM (
-- Constrain Output with WHERE
SELECT
subq_14.guest__bookers
subq_14.listing__bookers
, subq_14.bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_13.guest__bookers
subq_13.listing__bookers
, subq_13.bookers
FROM (
-- Join Standard Outputs
SELECT
subq_6.guest AS guest
, subq_12.guest__bookers AS guest__bookers
subq_6.listing AS listing
, subq_12.listing__bookers AS listing__bookers
, subq_6.bookers AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_5.guest
subq_5.listing
, subq_5.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -227,24 +227,24 @@ FROM (
) subq_5
) subq_6
LEFT OUTER JOIN (
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
subq_11.guest
, subq_11.guest__bookers
subq_11.listing
, subq_11.listing__bookers
FROM (
-- Compute Metrics via Expressions
SELECT
subq_10.guest
, subq_10.bookers AS guest__bookers
subq_10.listing
, subq_10.bookers AS listing__bookers
FROM (
-- Aggregate Measures
SELECT
subq_9.guest
subq_9.listing
, COUNT(DISTINCT subq_9.bookers) AS bookers
FROM (
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
subq_8.guest
subq_8.listing
, subq_8.bookers
FROM (
-- Metric Time Dimension 'ds'
Expand Down Expand Up @@ -443,15 +443,15 @@ FROM (
) subq_8
) subq_9
GROUP BY
subq_9.guest
subq_9.listing
) subq_10
) subq_11
) subq_12
ON
subq_6.guest = subq_12.guest
subq_6.listing = subq_12.listing
) subq_13
) subq_14
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
) subq_15
) subq_16
) subq_17
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ SELECT
COUNT(DISTINCT bookers) AS bookers
FROM (
-- Join Standard Outputs
-- Pass Only Elements: ['bookers', 'guest__bookers']
-- Pass Only Elements: ['bookers', 'listing__bookers']
SELECT
subq_26.guest__bookers AS guest__bookers
subq_26.listing__bookers AS listing__bookers
, subq_20.bookers AS bookers
FROM (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
SELECT
guest_id AS guest
listing_id AS listing
, guest_id AS bookers
FROM ***************************.fct_bookings bookings_source_src_28000
) subq_20
LEFT OUTER JOIN (
-- Read Elements From Semantic Model 'bookings_source'
-- Metric Time Dimension 'ds'
-- Pass Only Elements: ['bookers', 'guest']
-- Pass Only Elements: ['bookers', 'listing']
-- Aggregate Measures
-- Compute Metrics via Expressions
-- Pass Only Elements: ['guest', 'guest__bookers']
-- Pass Only Elements: ['listing', 'listing__bookers']
SELECT
guest_id AS guest
, COUNT(DISTINCT guest_id) AS guest__bookers
listing_id AS listing
, COUNT(DISTINCT guest_id) AS listing__bookers
FROM ***************************.fct_bookings bookings_source_src_28000
GROUP BY
guest_id
listing_id
) subq_26
ON
subq_20.guest = subq_26.guest
subq_20.listing = subq_26.listing
) subq_28
WHERE guest__bookers > 1.00
WHERE listing__bookers > 1.00
Loading

0 comments on commit ef8cbac

Please sign in to comment.