Skip to content

Commit 1234e0d

Browse files
committed
Update snapshots
1 parent 567e03f commit 1234e0d

7 files changed

Lines changed: 386 additions & 0 deletions
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
test_name: test_cases_with_dfs_planner[00__simple_metric]
2+
test_filename: test_dfs_planner.py
3+
docstring:
4+
Test enumerated cases using the `DepthFirstSearchMetricEvaluationPlanner`.
5+
---
6+
Query for a simple metric.
7+
8+
Metric Names: ['booking_value']
9+
Group-By Names: ['metric_time']
10+
Metric Evaluation Overview:
11+
┌───────┬───────────┬────────────────────┬───────────────────────┬──────────────────┬──────────────────┐
12+
│ id │ src_ids │ computed_outputs │ passthrough_outputs │ source_metrics │ semantic_model │
13+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
14+
│ smp_0 │ │ booking_value │ │ │ bookings_source │
15+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
16+
│ tpl_0 │ smp_0 │ │ booking_value │ booking_value │ │
17+
└───────┴───────────┴────────────────────┴───────────────────────┴──────────────────┴──────────────────┘
18+
Metric Query Output:
19+
┌───────┬──────────────────────────────────────────┬─────────────────────────────────────────────┐
20+
│ id │ output_specs │ output_properties │
21+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
22+
│ smp_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
23+
│ │ │ group_by_item_specs=['metric_time__day'], │
24+
│ │ │ pushdown_enabled_types={ │
25+
│ │ │ TIME_RANGE_CONSTRAINT, │
26+
│ │ │ CATEGORICAL_DIMENSION, │
27+
│ │ │ }, │
28+
│ │ │ ) │
29+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
30+
│ tpl_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
31+
│ │ │ group_by_item_specs=['metric_time__day'], │
32+
│ │ │ pushdown_enabled_types={ │
33+
│ │ │ TIME_RANGE_CONSTRAINT, │
34+
│ │ │ CATEGORICAL_DIMENSION, │
35+
│ │ │ }, │
36+
│ │ │ ) │
37+
└───────┴──────────────────────────────────────────┴─────────────────────────────────────────────┘
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
test_name: test_cases_with_dfs_planner[01__simple_metrics_from_common_model]
2+
test_filename: test_dfs_planner.py
3+
docstring:
4+
Test enumerated cases using the `DepthFirstSearchMetricEvaluationPlanner`.
5+
expectation_description:
6+
For the passthrough planner: a single query can resolve both metrics since they
7+
are from the same model.
8+
---
9+
Query for 2 simple metrics that are from the same model.
10+
11+
Metric Names: ['booking_value', 'bookings']
12+
Group-By Names: ['metric_time']
13+
Metric Evaluation Overview:
14+
┌───────┬───────────┬────────────────────┬───────────────────────┬──────────────────┬──────────────────┐
15+
│ id │ src_ids │ computed_outputs │ passthrough_outputs │ source_metrics │ semantic_model │
16+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
17+
│ smp_0 │ │ booking_value │ │ │ bookings_source │
18+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
19+
│ smp_1 │ │ bookings │ │ │ bookings_source │
20+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
21+
│ tpl_0 │ smp_0 │ │ booking_value │ booking_value │ │
22+
│ │ smp_1 │ │ bookings │ bookings │ │
23+
└───────┴───────────┴────────────────────┴───────────────────────┴──────────────────┴──────────────────┘
24+
Metric Query Output:
25+
┌───────┬──────────────────────────────────────────┬─────────────────────────────────────────────┐
26+
│ id │ output_specs │ output_properties │
27+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
28+
│ smp_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
29+
│ │ │ group_by_item_specs=['metric_time__day'], │
30+
│ │ │ pushdown_enabled_types={ │
31+
│ │ │ TIME_RANGE_CONSTRAINT, │
32+
│ │ │ CATEGORICAL_DIMENSION, │
33+
│ │ │ }, │
34+
│ │ │ ) │
35+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
36+
│ smp_1 │ MetricSpec(element_name='bookings') │ MetricQueryPropertySet( │
37+
│ │ │ group_by_item_specs=['metric_time__day'], │
38+
│ │ │ pushdown_enabled_types={ │
39+
│ │ │ TIME_RANGE_CONSTRAINT, │
40+
│ │ │ CATEGORICAL_DIMENSION, │
41+
│ │ │ }, │
42+
│ │ │ ) │
43+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
44+
│ tpl_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
45+
│ │ MetricSpec(element_name='bookings') │ group_by_item_specs=['metric_time__day'], │
46+
│ │ │ pushdown_enabled_types={ │
47+
│ │ │ TIME_RANGE_CONSTRAINT, │
48+
│ │ │ CATEGORICAL_DIMENSION, │
49+
│ │ │ }, │
50+
│ │ │ ) │
51+
└───────┴──────────────────────────────────────────┴─────────────────────────────────────────────┘
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
test_name: test_cases_with_dfs_planner[02__simple_metric_in_derived_metric]
2+
test_filename: test_dfs_planner.py
3+
docstring:
4+
Test enumerated cases using the `DepthFirstSearchMetricEvaluationPlanner`.
5+
expectation_description:
6+
For the passthrough planner: since `booking_fees` is derived from
7+
`booking_value`, the node that computes `booking_fees` can pass through
8+
`booking_value` and avoid the need for a FOJ in the top-level query.
9+
---
10+
Query for a derived metric and one of its input metrics.
11+
12+
Metric Names: ['booking_value', 'booking_fees']
13+
Group-By Names: ['metric_time']
14+
Metric Evaluation Overview:
15+
┌───────┬───────────┬────────────────────┬───────────────────────┬──────────────────┬──────────────────┐
16+
│ id │ src_ids │ computed_outputs │ passthrough_outputs │ source_metrics │ semantic_model │
17+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
18+
│ smp_0 │ │ booking_value │ │ │ bookings_source │
19+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
20+
│ drv_0 │ smp_0 │ booking_fees │ │ booking_value │ │
21+
├───────┼───────────┼────────────────────┼───────────────────────┼──────────────────┼──────────────────┤
22+
│ tpl_0 │ smp_0 │ │ booking_value │ booking_value │ │
23+
│ │ drv_0 │ │ booking_fees │ booking_fees │ │
24+
└───────┴───────────┴────────────────────┴───────────────────────┴──────────────────┴──────────────────┘
25+
Metric Query Output:
26+
┌───────┬──────────────────────────────────────────┬─────────────────────────────────────────────┐
27+
│ id │ output_specs │ output_properties │
28+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
29+
│ smp_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
30+
│ │ │ group_by_item_specs=['metric_time__day'], │
31+
│ │ │ pushdown_enabled_types={ │
32+
│ │ │ TIME_RANGE_CONSTRAINT, │
33+
│ │ │ CATEGORICAL_DIMENSION, │
34+
│ │ │ }, │
35+
│ │ │ ) │
36+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
37+
│ drv_0 │ MetricSpec(element_name='booking_fees') │ MetricQueryPropertySet( │
38+
│ │ │ group_by_item_specs=['metric_time__day'], │
39+
│ │ │ pushdown_enabled_types={ │
40+
│ │ │ TIME_RANGE_CONSTRAINT, │
41+
│ │ │ CATEGORICAL_DIMENSION, │
42+
│ │ │ }, │
43+
│ │ │ ) │
44+
├───────┼──────────────────────────────────────────┼─────────────────────────────────────────────┤
45+
│ tpl_0 │ MetricSpec(element_name='booking_value') │ MetricQueryPropertySet( │
46+
│ │ MetricSpec(element_name='booking_fees') │ group_by_item_specs=['metric_time__day'], │
47+
│ │ │ pushdown_enabled_types={ │
48+
│ │ │ TIME_RANGE_CONSTRAINT, │
49+
│ │ │ CATEGORICAL_DIMENSION, │
50+
│ │ │ }, │
51+
│ │ │ ) │
52+
└───────┴──────────────────────────────────────────┴─────────────────────────────────────────────┘

0 commit comments

Comments
 (0)