diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__accumulate_last_2_months_metric__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__accumulate_last_2_months_metric__set0.txt new file mode 100644 index 0000000000..5471827922 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__accumulate_last_2_months_metric__set0.txt @@ -0,0 +1,6 @@ +[ + "TimeDimension('metric_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'year')", +] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_different_parent_time_grains__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_different_parent_time_grains__set0.txt new file mode 100644 index 0000000000..9fd4d24655 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_different_parent_time_grains__set0.txt @@ -0,0 +1 @@ +["TimeDimension('metric_time', 'year')", "TimeDimension('metric_time', 'year', date_part_name='year')"] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_same_parent_time_grains__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_same_parent_time_grains__set0.txt new file mode 100644 index 0000000000..bc04ca36c1 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__derived_metric_with_same_parent_time_grains__set0.txt @@ -0,0 +1,20 @@ +[ + "TimeDimension('metric_time', 'month')", + "TimeDimension('metric_time', 'month', date_part_name='month')", + "TimeDimension('metric_time', 'month', date_part_name='quarter')", + "TimeDimension('metric_time', 'month', date_part_name='year')", + "TimeDimension('metric_time', 'quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='year')", + "TimeDimension('metric_time', 'year')", + "TimeDimension('metric_time', 'year', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year', date_part_name='year')", +] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_different_time_grains__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_different_time_grains__set0.txt new file mode 100644 index 0000000000..9fd4d24655 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_different_time_grains__set0.txt @@ -0,0 +1 @@ +["TimeDimension('metric_time', 'year')", "TimeDimension('metric_time', 'year', date_part_name='year')"] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_same_time_grains__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_same_time_grains__set0.txt new file mode 100644 index 0000000000..bc04ca36c1 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__metrics_with_same_time_grains__set0.txt @@ -0,0 +1,20 @@ +[ + "TimeDimension('metric_time', 'month')", + "TimeDimension('metric_time', 'month', date_part_name='month')", + "TimeDimension('metric_time', 'month', date_part_name='quarter')", + "TimeDimension('metric_time', 'month', date_part_name='year')", + "TimeDimension('metric_time', 'quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='year')", + "TimeDimension('metric_time', 'year')", + "TimeDimension('metric_time', 'year', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year', date_part_name='year')", +] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__no_metrics__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__no_metrics__set0.txt new file mode 100644 index 0000000000..108ea1fbff --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__no_metrics__set0.txt @@ -0,0 +1,13 @@ +[ + "TimeDimension('monthly_measure_entity__creation_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year', date_part_name='year')", + "TimeDimension('yearly_measure_entity__creation_time', 'year')", + "TimeDimension('yearly_measure_entity__creation_time', 'year', date_part_name='year')", +] diff --git a/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__simple_metric__set0.txt b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__simple_metric__set0.txt new file mode 100644 index 0000000000..bc04ca36c1 --- /dev/null +++ b/metricflow/test/snapshots/test_available_group_by_items.py/LinkableSpecSet/test_available_group_by_items__simple_metric__set0.txt @@ -0,0 +1,20 @@ +[ + "TimeDimension('metric_time', 'month')", + "TimeDimension('metric_time', 'month', date_part_name='month')", + "TimeDimension('metric_time', 'month', date_part_name='quarter')", + "TimeDimension('metric_time', 'month', date_part_name='year')", + "TimeDimension('metric_time', 'quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='quarter')", + "TimeDimension('metric_time', 'quarter', date_part_name='year')", + "TimeDimension('metric_time', 'year')", + "TimeDimension('metric_time', 'year', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='month')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'month', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='quarter')", + "TimeDimension('monthly_measure_entity__creation_time', 'quarter', date_part_name='year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year')", + "TimeDimension('monthly_measure_entity__creation_time', 'year', date_part_name='year')", +] diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt new file mode 100644 index 0000000000..a687fce8a6 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt @@ -0,0 +1 @@ +GroupByItemResolution(spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH)) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt new file mode 100644 index 0000000000..4f335a25f2 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt @@ -0,0 +1,67 @@ +GroupByItemResolution( + 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), + ), + ), + ), + ), + ), + ), + ), +) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt new file mode 100644 index 0000000000..a687fce8a6 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt @@ -0,0 +1 @@ +GroupByItemResolution(spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH)) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt new file mode 100644 index 0000000000..ca5af91d22 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt @@ -0,0 +1,60 @@ +GroupByItemResolution( + 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), + ), + ), + ), + ), + ), + ), + ), +) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt new file mode 100644 index 0000000000..a687fce8a6 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt @@ -0,0 +1 @@ +GroupByItemResolution(spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH)) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__no_metrics__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__no_metrics__result.txt new file mode 100644 index 0000000000..06e525ece0 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__no_metrics__result.txt @@ -0,0 +1,15 @@ +GroupByItemResolution( + issue_set=MetricFlowQueryResolutionIssueSet( + issues=( + NoMatchingItemsForNoMetricsQuery( + issue_type=ERROR, + query_resolution_path=MetricFlowQueryResolutionPath( + resolution_path_nodes=( + QueryGroupByItemResolutionNode(node_id=qr_0), + NoMetricsGroupByItemSourceNode(node_id=vr_0), + ), + ), + ), + ), + ), +) diff --git a/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt new file mode 100644 index 0000000000..a687fce8a6 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_filters.py/str/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt @@ -0,0 +1 @@ +GroupByItemResolution(spec=TimeDimensionSpec(element_name='metric_time', time_granularity=MONTH)) diff --git a/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_invalid_group_by_item__result.txt b/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_invalid_group_by_item__result.txt new file mode 100644 index 0000000000..a0fcdd41f3 --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_invalid_group_by_item__result.txt @@ -0,0 +1,26 @@ +GroupByItemResolution( + issue_set=MetricFlowQueryResolutionIssueSet( + issues=( + NoMatchingItemsForMeasure( + issue_type=ERROR, + query_resolution_path=MetricFlowQueryResolutionPath( + resolution_path_nodes=( + QueryGroupByItemResolutionNode(node_id=qr_3), + MetricGroupByItemResolutionNode(node_id=mtr_3), + MeasureGroupByItemSourceNode(node_id=msr_3), + ), + ), + ), + NoMatchingItemsForMeasure( + issue_type=ERROR, + query_resolution_path=MetricFlowQueryResolutionPath( + resolution_path_nodes=( + QueryGroupByItemResolutionNode(node_id=qr_3), + MetricGroupByItemResolutionNode(node_id=mtr_4), + MeasureGroupByItemSourceNode(node_id=msr_4), + ), + ), + ), + ), + ), +) diff --git a/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_unavailable_group_by_item_in_derived_metric_parent__result.txt b/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_unavailable_group_by_item_in_derived_metric_parent__result.txt new file mode 100644 index 0000000000..4eac17bbba --- /dev/null +++ b/metricflow/test/snapshots/test_matching_item_for_querying.py/str/test_unavailable_group_by_item_in_derived_metric_parent__result.txt @@ -0,0 +1,17 @@ +GroupByItemResolution( + issue_set=MetricFlowQueryResolutionIssueSet( + issues=( + NoMatchingItemsForMeasure( + issue_type=ERROR, + query_resolution_path=MetricFlowQueryResolutionPath( + resolution_path_nodes=( + QueryGroupByItemResolutionNode(node_id=qr_5), + MetricGroupByItemResolutionNode(node_id=mtr_10), + MetricGroupByItemResolutionNode(node_id=mtr_9), + MeasureGroupByItemSourceNode(node_id=msr_8), + ), + ), + ), + ), + ), +)