|
| 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