Skip to content

Commit

Permalink
Add snapshots for filter spec resolution tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Nov 30, 2023
1 parent 4b080ac commit a716bc7
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FilterSpecResolutionLookUp(
issue_set=MetricFlowQueryResolutionIssueSet(
issues=(
NoCommonItemsInParents(
issue_type=ERROR,
query_resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(MetricGroupByItemResolutionNode(node_id=mtr_2),),
),
parent_candidate_sets=(
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=MONTH,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_0),
MeasureGroupByItemSourceNode(node_id=msr_0),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_0),
),
),
),
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=YEAR,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_1),
MeasureGroupByItemSourceNode(node_id=msr_1),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_1),
),
),
),
),
),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FilterSpecResolutionLookUp(
issue_set=MetricFlowQueryResolutionIssueSet(
issues=(
NoCommonItemsInParents(
issue_type=ERROR,
query_resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(MetricGroupByItemResolutionNode(node_id=mtr_2),),
),
parent_candidate_sets=(
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=MONTH,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_0),
MeasureGroupByItemSourceNode(node_id=msr_0),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_0),
),
),
),
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=YEAR,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_1),
MeasureGroupByItemSourceNode(node_id=msr_1),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
MetricGroupByItemResolutionNode(node_id=mtr_2),
MetricGroupByItemResolutionNode(node_id=mtr_1),
),
),
),
),
),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FilterSpecResolutionLookUp(
spec_resolutions=(
FilterSpecResolution(
lookup_key=ResolvedSpecLookUpKey(
filter_location=WhereFilterLocation(
metric_references=(
MetricReference(
element_name='derived_metric_with_same_parent_time_grains',
),
),
),
call_parameter_set=TimeDimensionCallParameterSet(
time_dimension_reference=TimeDimensionReference(
element_name='metric_time',
),
),
),
resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_0),
MetricGroupByItemResolutionNode(node_id=mtr_2),
),
),
resolved_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FilterSpecResolutionLookUp(
spec_resolutions=(
FilterSpecResolution(
lookup_key=ResolvedSpecLookUpKey(
filter_location=WhereFilterLocation(
metric_references=(
MetricReference(
element_name='derived_metric_with_same_parent_time_grains',
),
),
),
call_parameter_set=TimeDimensionCallParameterSet(
time_dimension_reference=TimeDimensionReference(
element_name='metric_time',
),
),
),
resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_0),
MetricGroupByItemResolutionNode(node_id=mtr_3),
MetricGroupByItemResolutionNode(node_id=mtr_2),
),
),
resolved_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FilterSpecResolutionLookUp(
spec_resolutions=(
FilterSpecResolution(
lookup_key=ResolvedSpecLookUpKey(
filter_location=WhereFilterLocation(
metric_references=(
MetricReference(
element_name='accumulate_last_2_months_metric',
),
),
),
call_parameter_set=TimeDimensionCallParameterSet(
time_dimension_reference=TimeDimensionReference(
element_name='metric_time',
),
),
),
resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(QueryGroupByItemResolutionNode(node_id=qr_6),),
),
resolved_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FilterSpecResolutionLookUp(
issue_set=MetricFlowQueryResolutionIssueSet(
issues=(
NoCommonItemsInParents(
issue_type=ERROR,
query_resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_5),
MetricGroupByItemResolutionNode(node_id=mtr_10),
),
),
parent_candidate_sets=(
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=MONTH,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_5),
MetricGroupByItemResolutionNode(node_id=mtr_10),
MetricGroupByItemResolutionNode(node_id=mtr_8),
MeasureGroupByItemSourceNode(node_id=msr_7),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_5),
MetricGroupByItemResolutionNode(node_id=mtr_10),
MetricGroupByItemResolutionNode(node_id=mtr_8),
),
),
),
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=YEAR,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_5),
MetricGroupByItemResolutionNode(node_id=mtr_10),
MetricGroupByItemResolutionNode(node_id=mtr_9),
MeasureGroupByItemSourceNode(node_id=msr_8),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_5),
MetricGroupByItemResolutionNode(node_id=mtr_10),
MetricGroupByItemResolutionNode(node_id=mtr_9),
),
),
),
),
),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FilterSpecResolutionLookUp(
spec_resolutions=(
FilterSpecResolution(
lookup_key=ResolvedSpecLookUpKey(
filter_location=WhereFilterLocation(
metric_references=(
MetricReference(
element_name='derived_metric_with_same_parent_time_grains',
),
),
),
call_parameter_set=TimeDimensionCallParameterSet(
time_dimension_reference=TimeDimensionReference(
element_name='metric_time',
),
),
),
resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(QueryGroupByItemResolutionNode(node_id=qr_4),),
),
resolved_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FilterSpecResolutionLookUp(
issue_set=MetricFlowQueryResolutionIssueSet(
issues=(
NoCommonItemsInParents(
issue_type=ERROR,
query_resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(QueryGroupByItemResolutionNode(node_id=qr_3),),
),
parent_candidate_sets=(
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=MONTH,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_3),
MetricGroupByItemResolutionNode(node_id=mtr_3),
MeasureGroupByItemSourceNode(node_id=msr_3),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_3),
MetricGroupByItemResolutionNode(node_id=mtr_3),
),
),
),
GroupByItemCandidateSet(
specs=(
TimeDimensionSpec(
element_name='metric_time',
time_granularity=YEAR,
),
),
measure_paths=(
MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_3),
MetricGroupByItemResolutionNode(node_id=mtr_4),
MeasureGroupByItemSourceNode(node_id=msr_4),
),
),
),
path_from_leaf_node=MetricFlowQueryResolutionPath(
resolution_path_nodes=(
QueryGroupByItemResolutionNode(node_id=qr_3),
MetricGroupByItemResolutionNode(node_id=mtr_4),
),
),
),
),
),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FilterSpecResolutionLookUp(
spec_resolutions=(
FilterSpecResolution(
lookup_key=ResolvedSpecLookUpKey(
filter_location=WhereFilterLocation(
metric_references=(
MetricReference(
element_name='monthly_metric_0',
),
MetricReference(
element_name='monthly_metric_1',
),
),
),
call_parameter_set=TimeDimensionCallParameterSet(
time_dimension_reference=TimeDimensionReference(
element_name='metric_time',
),
),
),
resolution_path=MetricFlowQueryResolutionPath(
resolution_path_nodes=(QueryGroupByItemResolutionNode(node_id=qr_2),),
),
resolved_spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH),
),
),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FilterSpecResolutionLookUp()
Loading

0 comments on commit a716bc7

Please sign in to comment.