-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
160 additions
and
0 deletions.
There are no files selected for viewing
160 changes: 160 additions & 0 deletions
160
...cflow/snapshots/test_common_dataflow_branches.py/str/test_shared_metric_query__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
test_name: test_shared_metric_query | ||
test_filename: test_common_dataflow_branches.py | ||
docstring: | ||
For a known case, test that a metric computation node is identified as a common branch. | ||
|
||
A query for `bookings` and `bookings_per_booker` should have the computation for `bookings` as a common branch in | ||
the dataflow plan. | ||
--- | ||
dataflow_plan: | ||
<DataflowPlan> | ||
<WriteToResultDataTableNode> | ||
<!-- description = 'Write to DataTable' --> | ||
<!-- node_id = NodeId(id_str='wrd_0') --> | ||
<CombineAggregatedOutputsNode> | ||
<!-- description = 'Combine Aggregated Outputs' --> | ||
<!-- node_id = NodeId(id_str='cao_1') --> | ||
<ComputeMetricsNode> | ||
<!-- description = 'Compute Metrics via Expressions' --> | ||
<!-- node_id = NodeId(id_str='cm_0') --> | ||
<!-- metric_spec = MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()) --> | ||
<AggregateMeasuresNode> | ||
<!-- description = 'Aggregate Measures' --> | ||
<!-- node_id = NodeId(id_str='am_0') --> | ||
<FilterElementsNode> | ||
<!-- description = "Pass Only Elements: ['bookings', 'metric_time__day']" --> | ||
<!-- node_id = NodeId(id_str='pfe_0') --> | ||
<!-- include_spec = MeasureSpec(element_name='bookings') --> | ||
<!-- include_spec = --> | ||
<!-- TimeDimensionSpec( --> | ||
<!-- element_name='metric_time', --> | ||
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), --> | ||
<!-- ) --> | ||
<!-- distinct = False --> | ||
<MetricTimeDimensionTransformNode> | ||
<!-- description = "Metric Time Dimension 'ds'" --> | ||
<!-- node_id = NodeId(id_str='sma_28009') --> | ||
<!-- aggregation_time_dimension = 'ds' --> | ||
<ReadSqlSourceNode> | ||
<!-- description = "Read From SemanticModelDataSet('bookings_source')" --> | ||
<!-- node_id = NodeId(id_str='rss_28020') --> | ||
<!-- data_set = SemanticModelDataSet('bookings_source') --> | ||
</ReadSqlSourceNode> | ||
</MetricTimeDimensionTransformNode> | ||
</FilterElementsNode> | ||
</AggregateMeasuresNode> | ||
</ComputeMetricsNode> | ||
<ComputeMetricsNode> | ||
<!-- description = 'Compute Metrics via Expressions' --> | ||
<!-- node_id = NodeId(id_str='cm_2') --> | ||
<!-- metric_spec = MetricSpec(element_name='bookings_per_booker', filter_spec_set=WhereFilterSpecSet()) --> | ||
<CombineAggregatedOutputsNode> | ||
<!-- description = 'Combine Aggregated Outputs' --> | ||
<!-- node_id = NodeId(id_str='cao_0') --> | ||
<ComputeMetricsNode> | ||
<!-- description = 'Compute Metrics via Expressions' --> | ||
<!-- node_id = NodeId(id_str='cm_0') --> | ||
<!-- metric_spec = MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()) --> | ||
<AggregateMeasuresNode> | ||
<!-- description = 'Aggregate Measures' --> | ||
<!-- node_id = NodeId(id_str='am_0') --> | ||
<FilterElementsNode> | ||
<!-- description = "Pass Only Elements: ['bookings', 'metric_time__day']" --> | ||
<!-- node_id = NodeId(id_str='pfe_0') --> | ||
<!-- include_spec = MeasureSpec(element_name='bookings') --> | ||
<!-- include_spec = --> | ||
<!-- TimeDimensionSpec( --> | ||
<!-- element_name='metric_time', --> | ||
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), --> | ||
<!-- ) --> | ||
<!-- distinct = False --> | ||
<MetricTimeDimensionTransformNode> | ||
<!-- description = "Metric Time Dimension 'ds'" --> | ||
<!-- node_id = NodeId(id_str='sma_28009') --> | ||
<!-- aggregation_time_dimension = 'ds' --> | ||
<ReadSqlSourceNode> | ||
<!-- description = "Read From SemanticModelDataSet('bookings_source')" --> | ||
<!-- node_id = NodeId(id_str='rss_28020') --> | ||
<!-- data_set = SemanticModelDataSet('bookings_source') --> | ||
</ReadSqlSourceNode> | ||
</MetricTimeDimensionTransformNode> | ||
</FilterElementsNode> | ||
</AggregateMeasuresNode> | ||
</ComputeMetricsNode> | ||
<ComputeMetricsNode> | ||
<!-- description = 'Compute Metrics via Expressions' --> | ||
<!-- node_id = NodeId(id_str='cm_1') --> | ||
<!-- metric_spec = MetricSpec(element_name='bookers', filter_spec_set=WhereFilterSpecSet()) --> | ||
<AggregateMeasuresNode> | ||
<!-- description = 'Aggregate Measures' --> | ||
<!-- node_id = NodeId(id_str='am_1') --> | ||
<FilterElementsNode> | ||
<!-- description = "Pass Only Elements: ['bookers', 'metric_time__day']" --> | ||
<!-- node_id = NodeId(id_str='pfe_1') --> | ||
<!-- include_spec = MeasureSpec(element_name='bookers') --> | ||
<!-- include_spec = --> | ||
<!-- TimeDimensionSpec( --> | ||
<!-- element_name='metric_time', --> | ||
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), --> | ||
<!-- ) --> | ||
<!-- distinct = False --> | ||
<MetricTimeDimensionTransformNode> | ||
<!-- description = "Metric Time Dimension 'ds'" --> | ||
<!-- node_id = NodeId(id_str='sma_28009') --> | ||
<!-- aggregation_time_dimension = 'ds' --> | ||
<ReadSqlSourceNode> | ||
<!-- description = "Read From SemanticModelDataSet('bookings_source')" --> | ||
<!-- node_id = NodeId(id_str='rss_28020') --> | ||
<!-- data_set = SemanticModelDataSet('bookings_source') --> | ||
</ReadSqlSourceNode> | ||
</MetricTimeDimensionTransformNode> | ||
</FilterElementsNode> | ||
</AggregateMeasuresNode> | ||
</ComputeMetricsNode> | ||
</CombineAggregatedOutputsNode> | ||
</ComputeMetricsNode> | ||
</CombineAggregatedOutputsNode> | ||
</WriteToResultDataTableNode> | ||
</DataflowPlan> | ||
common_branch_0: | ||
<ComputeMetricsNode> | ||
<!-- description = 'Compute Metrics via Expressions' --> | ||
<!-- node_id = NodeId(id_str='cm_0') --> | ||
<!-- metric_spec = MetricSpec(element_name='bookings', filter_spec_set=WhereFilterSpecSet()) --> | ||
<AggregateMeasuresNode> | ||
<!-- description = 'Aggregate Measures' --> | ||
<!-- node_id = NodeId(id_str='am_0') --> | ||
<FilterElementsNode> | ||
<!-- description = "Pass Only Elements: ['bookings', 'metric_time__day']" --> | ||
<!-- node_id = NodeId(id_str='pfe_0') --> | ||
<!-- include_spec = MeasureSpec(element_name='bookings') --> | ||
<!-- include_spec = --> | ||
<!-- TimeDimensionSpec( --> | ||
<!-- element_name='metric_time', --> | ||
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), --> | ||
<!-- ) --> | ||
<!-- distinct = False --> | ||
<MetricTimeDimensionTransformNode> | ||
<!-- description = "Metric Time Dimension 'ds'" --> | ||
<!-- node_id = NodeId(id_str='sma_28009') --> | ||
<!-- aggregation_time_dimension = 'ds' --> | ||
<ReadSqlSourceNode> | ||
<!-- description = "Read From SemanticModelDataSet('bookings_source')" --> | ||
<!-- node_id = NodeId(id_str='rss_28020') --> | ||
<!-- data_set = SemanticModelDataSet('bookings_source') --> | ||
</ReadSqlSourceNode> | ||
</MetricTimeDimensionTransformNode> | ||
</FilterElementsNode> | ||
</AggregateMeasuresNode> | ||
</ComputeMetricsNode> | ||
common_branch_1: | ||
<MetricTimeDimensionTransformNode> | ||
<!-- description = "Metric Time Dimension 'ds'" --> | ||
<!-- node_id = NodeId(id_str='sma_28009') --> | ||
<!-- aggregation_time_dimension = 'ds' --> | ||
<ReadSqlSourceNode> | ||
<!-- description = "Read From SemanticModelDataSet('bookings_source')" --> | ||
<!-- node_id = NodeId(id_str='rss_28020') --> | ||
<!-- data_set = SemanticModelDataSet('bookings_source') --> | ||
</ReadSqlSourceNode> | ||
</MetricTimeDimensionTransformNode> |