From 02ea3afd5a7a5d3fbc0002b158644471aef47f56 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Fri, 25 Apr 2025 18:22:41 -0700 Subject: [PATCH 1/2] Remove unused SCD code --- .../model/linkable_element_property.py | 2 - .../semantics/linkable_spec_index_builder.py | 58 +++++-------------- .../model/semantics/linkable_spec_resolver.py | 17 ------ .../model/semantics/metric_lookup.py | 13 ----- .../metric_time_requirements.py | 4 -- 5 files changed, 13 insertions(+), 81 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/model/linkable_element_property.py b/metricflow-semantics/metricflow_semantics/model/linkable_element_property.py index ab43a1adff..642a9b3449 100644 --- a/metricflow-semantics/metricflow_semantics/model/linkable_element_property.py +++ b/metricflow-semantics/metricflow_semantics/model/linkable_element_property.py @@ -29,8 +29,6 @@ class LinkableElementProperty(Enum): METRIC = "metric" # A time dimension with a DatePart. DATE_PART = "date_part" - # A linkable element that is itself part of an SCD model, or a linkable element that gets joined through another SCD model. - SCD_HOP = "scd_hop" @staticmethod def all_properties() -> FrozenSet[LinkableElementProperty]: # noqa: D102 diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py index 13f3bfffa5..40625afc22 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py @@ -95,8 +95,7 @@ def __init__( def build_index(self) -> LinkableSpecIndex: # noqa: D102 start_time = time.perf_counter() for metric in self._semantic_manifest.metrics: - # self._metric_references_to_metrics[MetricReference(metric.name)] = metric - linkable_sets_for_measure = [] + linkable_sets_for_measure: List[LinkableElementSet] = [] for measure in metric.measure_references: if metric.type is MetricType.CUMULATIVE: linkable_sets_for_measure.append( @@ -196,10 +195,6 @@ def build_index(self) -> LinkableSpecIndex: # noqa: D102 return self._linkable_spec_index - def _is_semantic_model_scd(self, semantic_model: SemanticModel) -> bool: - """Whether the semantic model's underlying table is an SCD.""" - return any(dim.validity_params is not None for dim in semantic_model.dimensions) - def _generate_linkable_time_dimensions( self, semantic_model_origin: SemanticModelReference, @@ -306,8 +301,6 @@ def get_joinable_metrics_for_semantic_model( necessary. """ properties = frozenset({LinkableElementProperty.METRIC, LinkableElementProperty.JOINED}) - if self._is_semantic_model_scd(semantic_model): - properties = properties.union({LinkableElementProperty.SCD_HOP}) join_path_has_path_links = len(using_join_path.path_elements) > 0 if join_path_has_path_links: @@ -352,14 +345,10 @@ def _get_elements_in_semantic_model(self, semantic_model: SemanticModel) -> Link if result is not None: return result - semantic_model_is_scd = self._is_semantic_model_scd(semantic_model) - linkable_dimensions = [] linkable_entities = [] entity_properties = frozenset({LinkableElementProperty.LOCAL, LinkableElementProperty.ENTITY}) - if semantic_model_is_scd: - entity_properties = entity_properties.union({LinkableElementProperty.SCD_HOP}) for entity in semantic_model.entities: linkable_entities.append( @@ -390,8 +379,6 @@ def _get_elements_in_semantic_model(self, semantic_model: SemanticModel) -> Link ) dimension_properties = frozenset({LinkableElementProperty.LOCAL}) - if semantic_model_is_scd: - dimension_properties = dimension_properties.union({LinkableElementProperty.SCD_HOP}) for entity_link in SemanticModelHelper.entity_links_for_local_elements(semantic_model): for dimension in semantic_model.dimensions: @@ -501,11 +488,9 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference measure_semantic_model: Optional[SemanticModel] = None defined_granularity: Optional[ExpandedTimeGranularity] = None if measure_reference: - # measure_semantic_model = self._get_semantic_model_for_measure(measure_reference) measure_semantic_model = self._manifest_object_lookup.get_semantic_model_containing_measure( measure_reference ) - semantic_model_is_scd = self._is_semantic_model_scd(measure_semantic_model) measure_agg_time_dimension_reference = measure_semantic_model.checked_agg_time_dimension_for_measure( measure_reference=measure_reference ) @@ -518,7 +503,6 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference # If querying metric_time without metrics, will query from time spines. # Defaults to DAY granularity if available in time spines, else smallest available granularity. min_granularity = min(self._time_spine_sources.keys()) - semantic_model_is_scd = False possible_metric_time_granularities = tuple( ExpandedTimeGranularity.from_time_granularity(time_granularity) for time_granularity in TimeGranularity @@ -538,8 +522,6 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference properties = {LinkableElementProperty.METRIC_TIME} if time_granularity != defined_granularity: properties.add(LinkableElementProperty.DERIVED_TIME_GRANULARITY) - if semantic_model_is_scd: - properties.add(LinkableElementProperty.SCD_HOP) linkable_dimension = LinkableDimension.create( defined_in_semantic_model=measure_semantic_model.reference if measure_semantic_model else None, element_name=MetricFlowReservedKeywords.METRIC_TIME.value, @@ -561,8 +543,6 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference if date_part.to_int() < min_granularity.to_int(): continue properties = {LinkableElementProperty.METRIC_TIME, LinkableElementProperty.DATE_PART} - if semantic_model_is_scd: - properties.add(LinkableElementProperty.SCD_HOP) linkable_dimension = LinkableDimension.create( defined_in_semantic_model=measure_semantic_model.reference if measure_semantic_model else None, element_name=MetricFlowReservedKeywords.METRIC_TIME.value, @@ -656,36 +636,35 @@ def _get_joined_elements_without_cache( return LinkableElementSet.merge_by_path_key((single_hop_elements, multi_hop_elements)) + def _get_linkable_elements_accessible_from_semantic_model( + self, semantic_model: SemanticModel + ) -> LinkableElementSet: + elements_in_semantic_model = self._get_elements_in_semantic_model(semantic_model) + joined_elements = self._get_joined_elements(semantic_model.reference) + return LinkableElementSet.merge_by_path_key((elements_in_semantic_model, joined_elements)) + def _get_linkable_element_set_for_measure( self, measure_reference: MeasureReference, element_filter: LinkableElementFilter = LinkableElementFilter(), ) -> LinkableElementSet: """See get_linkable_element_set_for_measure().""" - # measure_semantic_model = self._get_semantic_model_for_measure(measure_reference) - measure_semantic_model = self._manifest_object_lookup.get_semantic_model_containing_measure(measure_reference) - - elements_in_semantic_model = self._get_elements_in_semantic_model(measure_semantic_model) + semantic_model = self._manifest_object_lookup.get_semantic_model_containing_measure(measure_reference) + linkable_elements = self._get_linkable_elements_accessible_from_semantic_model(semantic_model) # Filter out group-by metrics if not specified by the property as there can be a large number of them. if LinkableElementProperty.METRIC not in element_filter.without_any_of: metrics_linked_to_semantic_model = self.get_joinable_metrics_for_semantic_model( - semantic_model=measure_semantic_model, - using_join_path=SemanticModelJoinPath(left_semantic_model_reference=measure_semantic_model.reference), + semantic_model=semantic_model, + using_join_path=SemanticModelJoinPath(left_semantic_model_reference=semantic_model.reference), ) else: metrics_linked_to_semantic_model = LinkableElementSet() metric_time_elements = self._get_metric_time_elements(measure_reference) - joined_elements = self._get_joined_elements(measure_semantic_model.reference) return LinkableElementSet.merge_by_path_key( - ( - elements_in_semantic_model, - metrics_linked_to_semantic_model, - metric_time_elements, - joined_elements, - ) + (linkable_elements, metrics_linked_to_semantic_model, metric_time_elements) ).filter(element_filter) def get_linkable_element_set_for_measure( @@ -798,17 +777,6 @@ def create_linkable_element_set_from_join_path( if len(join_path.path_elements) > 1: properties = properties.union({LinkableElementProperty.MULTI_HOP}) - # If any of the semantic models in the join path is an SCD, add SCD_HOP - for reference_to_derived_model in join_path.derived_from_semantic_models: - derived_model = self._semantic_model_lookup.get_by_reference(reference_to_derived_model) - assert ( - derived_model - ), f"Semantic model {reference_to_derived_model.semantic_model_name} is in join path but does not exist in SemanticModelLookup" - - if self._is_semantic_model_scd(derived_model): - properties = properties.union({LinkableElementProperty.SCD_HOP}) - break - linkable_dimensions: List[LinkableDimension] = [] linkable_entities: List[LinkableEntity] = [] diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py index 6639dd200a..6dd1dd8234 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py @@ -63,10 +63,6 @@ def __init__( # noqa: D107 self._linkable_spec_index = linkable_spec_index self._manifest_object_lookup = manifest_object_lookup - def _is_semantic_model_scd(self, semantic_model: SemanticModel) -> bool: - """Whether the semantic model's underlying table is an SCD.""" - return any(dim.validity_params is not None for dim in semantic_model.dimensions) - def _generate_linkable_time_dimensions( self, semantic_model_origin: SemanticModelReference, @@ -157,8 +153,6 @@ def get_joinable_metrics_for_semantic_model( necessary. """ properties = frozenset({LinkableElementProperty.METRIC, LinkableElementProperty.JOINED}) - if self._is_semantic_model_scd(semantic_model): - properties = properties.union({LinkableElementProperty.SCD_HOP}) join_path_has_path_links = len(using_join_path.path_elements) > 0 if join_path_has_path_links: @@ -322,17 +316,6 @@ def create_linkable_element_set_from_join_path( if len(join_path.path_elements) > 1: properties = properties.union({LinkableElementProperty.MULTI_HOP}) - # If any of the semantic models in the join path is an SCD, add SCD_HOP - for reference_to_derived_model in join_path.derived_from_semantic_models: - derived_model = self._semantic_model_lookup.get_by_reference(reference_to_derived_model) - assert ( - derived_model - ), f"Semantic model {reference_to_derived_model.semantic_model_name} is in join path but does not exist in SemanticModelLookup" - - if self._is_semantic_model_scd(derived_model): - properties = properties.union({LinkableElementProperty.SCD_HOP}) - break - linkable_dimensions: List[LinkableDimension] = [] linkable_entities: List[LinkableEntity] = [] diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py index f73e253a3b..1b0da111e7 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py @@ -24,7 +24,6 @@ from metricflow_semantics.model.semantics.manifest_object_lookup import SemanticManifestObjectLookup from metricflow_semantics.model.semantics.semantic_model_join_evaluator import MAX_JOIN_HOPS from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup -from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.time.granularity import ExpandedTimeGranularity @@ -323,15 +322,3 @@ def _get_min_queryable_time_granularity(self, metric_reference: MetricReference) agg_time_dimension_grains.add(measure_properties.agg_time_granularity) return max(agg_time_dimension_grains, key=lambda time_granularity: time_granularity.to_int()) - - def get_joinable_scd_specs_for_metric(self, metric_reference: MetricReference) -> Sequence[LinkableInstanceSpec]: - """Get the SCDs that can be joined to a metric.""" - filter = LinkableElementFilter( - with_any_of=frozenset([LinkableElementProperty.SCD_HOP]), - ) - scd_elems = self.linkable_elements_for_metrics( - metric_references=(metric_reference,), - element_set_filter=filter, - ) - - return scd_elems.specs diff --git a/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py b/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py index 04b3f4c38b..a924643bf7 100644 --- a/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py +++ b/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py @@ -61,10 +61,6 @@ def __init__( # noqa: D107 > 0 ) - self._scd_linkable_element_set = self._resolve_group_by_item_result.linkable_element_set.filter( - LinkableElementFilter(with_any_of=frozenset({LinkableElementProperty.SCD_HOP})) - ) - def _query_includes_agg_time_dimension_of_metric(self, metric_reference: MetricReference) -> bool: valid_agg_time_dimensions = self._manifest_lookup.metric_lookup.get_valid_agg_time_dimensions_for_metric( metric_reference From 65fe3499165543c792eb14ed9a2d6fbab142d069 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 28 Apr 2025 13:44:14 -0700 Subject: [PATCH 2/2] WIP - fix perf for metrics as dims --- .../model/semantics/linkable_spec_index.py | 1 + .../semantics/linkable_spec_index_builder.py | 58 ++++++++++--------- .../str/test_all_properties__result0.txt | 36 ++++-------- .../test_cyclic_join_manifest__result0.txt | 24 ++++---- ...roperty_for_cumulative_metric__result0.txt | 12 ++-- ..._property_for_derived_metrics__result0.txt | 40 +++++-------- ...ccumulate_last_2_months_metric__result.txt | 7 +-- ...h_different_parent_time_grains__result.txt | 22 +------ ...c_with_same_parent_time_grains__result.txt | 7 +-- ...ics_with_different_time_grains__result.txt | 22 +------ ..._metrics_with_same_time_grains__result.txt | 7 +-- ...in_query_filter__simple_metric__result.txt | 7 +-- ...h_defined_metric_time_filter__result_0.txt | 5 +- ..._time_filter_on_input_metric__result_0.txt | 10 +--- ...h_defined_metric_time_filter__result_0.txt | 5 +- ...linkable_elements_for_measure__result0.txt | 24 ++++---- ...s_for_measure_multi_hop_model__result0.txt | 24 ++++---- ...imensions_in_different_models__result0.txt | 20 ++----- ...cs_with_common_filtered_metric__result.txt | 12 ++-- ...tion_for_invalid_metric_filter__result.txt | 24 +------- ...or_invalid_metric_input_filter__result.txt | 24 +------- ...lution_for_valid_metric_filter__result.txt | 6 +- ..._for_valid_metric_input_filter__result.txt | 6 +- ...ccumulate_last_2_months_metric__result.txt | 6 +- ...h_different_parent_time_grains__result.txt | 24 +------- ...c_with_same_parent_time_grains__result.txt | 6 +- ...ics_with_different_time_grains__result.txt | 24 +------- ..._metrics_with_same_time_grains__result.txt | 6 +- ...spec_resolution__simple_metric__result.txt | 6 +- ...join_to_time_spine_with_filters__dfp_0.xml | 22 ++++--- ...ry_have_different_granularities__dfp_0.xml | 20 +++---- ...ry_have_different_granularities__dfp_0.xml | 34 +++++------ ...constrained_plan_time_dimension__dfp_0.xml | 14 ++--- ..._time_pushdown_with_two_targets__dfp_0.xml | 14 ++--- ...time_pushdown_with_two_targets__dfpo_0.xml | 14 ++--- 35 files changed, 190 insertions(+), 403 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index.py index bf0d5037c3..cf08ac8981 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index.py @@ -34,3 +34,4 @@ class LinkableSpecIndex: semantic_model_reference_to_joined_elements: Dict[SemanticModelReference, LinkableElementSet] semantic_model_reference_to_local_elements: Dict[SemanticModelReference, LinkableElementSet] measure_to_metric_time_elements: Dict[Optional[MeasureReference], LinkableElementSet] + metric_time_elements: LinkableElementSet diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py index 40625afc22..3b6cb70652 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_index_builder.py @@ -184,9 +184,9 @@ def build_index(self) -> LinkableSpecIndex: # noqa: D102 for semantic_model in self._semantic_manifest.semantic_models: linkable_element_sets_for_no_metrics_queries.append(self._get_elements_in_semantic_model(semantic_model)) - metric_time_elements_for_no_metrics = self._get_metric_time_elements(measure_reference=None) + self._linkable_spec_index.metric_time_elements = self._get_metric_time_elements() self._linkable_spec_index.no_metric_linkable_element_set = LinkableElementSet.merge_by_path_key( - linkable_element_sets_for_no_metrics_queries + [metric_time_elements_for_no_metrics] + linkable_element_sets_for_no_metrics_queries + [self._linkable_spec_index.metric_time_elements] ) logger.debug( @@ -474,7 +474,9 @@ def _get_time_granularity_for_dimension( return type_params.time_granularity - def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference] = None) -> LinkableElementSet: + def _get_metric_time_elements_for_measure( + self, measure_reference: Optional[MeasureReference] = None + ) -> LinkableElementSet: """Create elements for metric_time for a given measure in a semantic model. metric_time is a virtual dimension that is the same as aggregation time dimension for a measure, but with a @@ -486,7 +488,7 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference return result measure_semantic_model: Optional[SemanticModel] = None - defined_granularity: Optional[ExpandedTimeGranularity] = None + defined_granularity: Optional[TimeGranularity] = None if measure_reference: measure_semantic_model = self._manifest_object_lookup.get_semantic_model_containing_measure( measure_reference @@ -494,15 +496,26 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference measure_agg_time_dimension_reference = measure_semantic_model.checked_agg_time_dimension_for_measure( measure_reference=measure_reference ) - min_granularity = self._get_time_granularity_for_dimension( + defined_granularity = self._get_time_granularity_for_dimension( semantic_model=measure_semantic_model, time_dimension_reference=measure_agg_time_dimension_reference, ) - defined_granularity = ExpandedTimeGranularity.from_time_granularity(min_granularity) - else: - # If querying metric_time without metrics, will query from time spines. - # Defaults to DAY granularity if available in time spines, else smallest available granularity. - min_granularity = min(self._time_spine_sources.keys()) + + metric_time_elements = self._get_metric_time_elements() + for path_key in metric_time_elements.path_key_to_linkable_dimensions: + pass # TODO: filter out any where granularity / date part is not compatible with defined_granularity + + self._linkable_spec_index.measure_to_metric_time_elements[measure_reference] = metric_time_elements + return metric_time_elements + + def _get_metric_time_elements(self) -> LinkableElementSet: + result = self._linkable_spec_index.metric_time_elements + if result is not None: + return result + + # If querying metric_time without metrics, will query from time spines. + # Defaults to DAY granularity if available in time spines, else smallest available granularity. + min_granularity = min(self._time_spine_sources.keys()) possible_metric_time_granularities = tuple( ExpandedTimeGranularity.from_time_granularity(time_granularity) for time_granularity in TimeGranularity @@ -520,19 +533,15 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference path_key_to_linkable_dimensions: Dict[ElementPathKey, List[LinkableDimension]] = defaultdict(list) for time_granularity in possible_metric_time_granularities: properties = {LinkableElementProperty.METRIC_TIME} - if time_granularity != defined_granularity: + if time_granularity != min_granularity: properties.add(LinkableElementProperty.DERIVED_TIME_GRANULARITY) linkable_dimension = LinkableDimension.create( - defined_in_semantic_model=measure_semantic_model.reference if measure_semantic_model else None, + defined_in_semantic_model=None, element_name=MetricFlowReservedKeywords.METRIC_TIME.value, dimension_type=DimensionType.TIME, entity_links=(), join_path=SemanticModelJoinPath( - left_semantic_model_reference=( - measure_semantic_model.reference - if measure_semantic_model - else SemanticModelDerivation.VIRTUAL_SEMANTIC_MODEL_REFERENCE - ), + left_semantic_model_reference=SemanticModelDerivation.VIRTUAL_SEMANTIC_MODEL_REFERENCE, ), properties=frozenset(properties), time_granularity=time_granularity, @@ -544,16 +553,12 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference continue properties = {LinkableElementProperty.METRIC_TIME, LinkableElementProperty.DATE_PART} linkable_dimension = LinkableDimension.create( - defined_in_semantic_model=measure_semantic_model.reference if measure_semantic_model else None, + defined_in_semantic_model=None, element_name=MetricFlowReservedKeywords.METRIC_TIME.value, dimension_type=DimensionType.TIME, entity_links=(), join_path=SemanticModelJoinPath( - left_semantic_model_reference=( - measure_semantic_model.reference - if measure_semantic_model - else SemanticModelDerivation.VIRTUAL_SEMANTIC_MODEL_REFERENCE - ), + left_semantic_model_reference=SemanticModelDerivation.VIRTUAL_SEMANTIC_MODEL_REFERENCE, ), properties=frozenset(properties), date_part=date_part, @@ -566,7 +571,7 @@ def _get_metric_time_elements(self, measure_reference: Optional[MeasureReference for path_key, linkable_dimensions in path_key_to_linkable_dimensions.items() } ) - self._linkable_spec_index.measure_to_metric_time_elements[measure_reference] = result + self._linkable_spec_index.metric_time_elements = result return result def _get_joined_elements(self, measure_semantic_model_reference: SemanticModelReference) -> LinkableElementSet: @@ -653,15 +658,14 @@ def _get_linkable_element_set_for_measure( linkable_elements = self._get_linkable_elements_accessible_from_semantic_model(semantic_model) # Filter out group-by metrics if not specified by the property as there can be a large number of them. + metrics_linked_to_semantic_model = LinkableElementSet() if LinkableElementProperty.METRIC not in element_filter.without_any_of: metrics_linked_to_semantic_model = self.get_joinable_metrics_for_semantic_model( semantic_model=semantic_model, using_join_path=SemanticModelJoinPath(left_semantic_model_reference=semantic_model.reference), ) - else: - metrics_linked_to_semantic_model = LinkableElementSet() - metric_time_elements = self._get_metric_time_elements(measure_reference) + metric_time_elements = self._get_metric_time_elements_for_measure(measure_reference) return LinkableElementSet.merge_by_path_key( (linkable_elements, metrics_linked_to_semantic_model, metric_time_elements) diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_all_properties__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_all_properties__result0.txt index 65d4bcbecc..aba9e0e58f 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_all_properties__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_all_properties__result0.txt @@ -3,19 +3,19 @@ test_filename: test_linkable_spec_resolver.py --- Model Join-Path Entity Links Name Time Granularity Date Part Properties --------------------------------------------------------- ------------------- -------------------- ------------------ ----------- --------------------------------------------------- +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('bookings_source',) () listing ['ENTITY', 'LOCAL'] -('bookings_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time day ['METRIC_TIME'] -('bookings_source',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('bookings_source', 'listings_latest') ('listing',) capacity_latest ['JOINED'] ('bookings_source', 'listings_latest') ('listing',) country_latest ['JOINED'] ('bookings_source', 'listings_latest') ('listing',) created_at DAY ['DATE_PART', 'JOINED'] @@ -156,18 +156,6 @@ Model Join-Path Entity Links ('bookings_source', 'listings_latest', 'users_latest') ('listing', 'user') home_state_latest ['JOINED', 'MULTI_HOP'] ('bookings_source', 'lux_listing_mapping') ('listing',) lux_listing ['ENTITY', 'JOINED'] ('views_source',) () listing ['ENTITY', 'LOCAL'] -('views_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time day ['METRIC_TIME'] -('views_source',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('views_source', 'listings_latest') ('listing',) capacity_latest ['JOINED'] ('views_source', 'listings_latest') ('listing',) country_latest ['JOINED'] ('views_source', 'listings_latest') ('listing',) created_at DAY ['DATE_PART', 'JOINED'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_cyclic_join_manifest__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_cyclic_join_manifest__result0.txt index d8188d1982..df711ec86f 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_cyclic_join_manifest__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_cyclic_join_manifest__result0.txt @@ -3,20 +3,20 @@ test_filename: test_linkable_spec_resolver.py --- Model Join-Path Entity Links Name Time Granularity Date Part Properties --------------------------------------------- ------------------ --------------- ------------------ ----------- ------------------------------------------- +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('listings_latest',) () cyclic_entity ['ENTITY', 'LOCAL'] ('listings_latest',) () listing ['ENTITY', 'LOCAL'] -('listings_latest',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time day ['METRIC_TIME'] -('listings_latest',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('listings_latest',) ('cyclic_entity',) country_latest ['LOCAL'] ('listings_latest',) ('cyclic_entity',) ds DAY ['DATE_PART', 'LOCAL'] ('listings_latest',) ('cyclic_entity',) ds DOW ['DATE_PART', 'LOCAL'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_cumulative_metric__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_cumulative_metric__result0.txt index 1f8e136c83..fb46e3811c 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_cumulative_metric__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_cumulative_metric__result0.txt @@ -3,9 +3,9 @@ test_filename: test_linkable_spec_resolver.py --- Model Join-Path Entity Links Name Time Granularity Date Part Properties ----------------- -------------- ----------- ------------------ ----------- ------------------------------------------- -('revenue',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('revenue',) () metric_time day ['METRIC_TIME'] -('revenue',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('revenue',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('revenue',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('revenue',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_derived_metrics__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_derived_metrics__result0.txt index c6021a3711..c61dfa0156 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_derived_metrics__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_linkable_spec_resolver.py/str/test_metric_time_property_for_derived_metrics__result0.txt @@ -1,29 +1,17 @@ test_name: test_metric_time_property_for_derived_metrics test_filename: test_linkable_spec_resolver.py --- -Model Join-Path Entity Links Name Time Granularity Date Part Properties --------------------- -------------- ----------- ------------------ ----------- ------------------------------------------- -('bookings_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time day ['METRIC_TIME'] -('bookings_source',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('bookings_source',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time day ['METRIC_TIME'] -('views_source',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('views_source',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +Model Join-Path Entity Links Name Time Granularity Date Part Properties +----------------- -------------- ----------- ------------------ ----------- ------------------------------------------- +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt index 1bec039383..f220ecfe98 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__accumulate_last_2_months_metric__result.txt @@ -17,15 +17,12 @@ GroupByItemResolution( ), ): ( LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), + properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt index e51b17ea93..93d450bb27 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_different_parent_time_grains__result.txt @@ -18,31 +18,11 @@ GroupByItemResolution( ): ( LinkableDimension( properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt index ebf3eb822a..dab08a48d1 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__derived_metric_with_same_parent_time_grains__result.txt @@ -17,15 +17,12 @@ GroupByItemResolution( ), ): ( LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), + properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt index be431427ae..615b5ab600 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_different_time_grains__result.txt @@ -18,31 +18,11 @@ GroupByItemResolution( ): ( LinkableDimension( properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt index 6a205fa444..ea5dbe2b58 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__metrics_with_same_time_grains__result.txt @@ -17,15 +17,12 @@ GroupByItemResolution( ), ): ( LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), + properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt index 80918e67a9..061b018e06 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_matching_item_for_filters.py/GroupByItemResolution/test_ambiguous_metric_time_in_query_filter__simple_metric__result.txt @@ -17,15 +17,12 @@ GroupByItemResolution( ), ): ( LinkableDimension( - properties=(METRIC_TIME,), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), + properties=(DERIVED_TIME_GRANULARITY, METRIC_TIME), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter__result_0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter__result_0.txt index fe19bf6e4f..cba5a39eb7 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter__result_0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter__result_0.txt @@ -55,14 +55,11 @@ MetricFlowQuerySpec( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter_on_input_metric__result_0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter_on_input_metric__result_0.txt index 38abd4d0c1..afda104beb 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter_on_input_metric__result_0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_derived_metric_with_defined_metric_time_filter_on_input_metric__result_0.txt @@ -58,14 +58,11 @@ MetricFlowQuerySpec( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( @@ -137,14 +134,11 @@ MetricFlowQuerySpec( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_simple_metric_with_defined_metric_time_filter__result_0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_simple_metric_with_defined_metric_time_filter__result_0.txt index 7e9038d135..4a2640d9f8 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_simple_metric_with_defined_metric_time_filter__result_0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_metric_time_granularity.py/MetricFlowQuerySpec/test_simple_metric_with_defined_metric_time_filter__result_0.txt @@ -55,14 +55,11 @@ MetricFlowQuerySpec( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure__result0.txt index 1b51b91f12..6869c8b129 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure__result0.txt @@ -5,19 +5,19 @@ docstring: --- Model Join-Path Entity Links Name Time Granularity Date Part Properties ------------------------------------------ --------------------------------------------- --------------------------------------------------- ------------------ ----------- ------------------------------------------- +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('listings_latest',) () listing ['ENTITY', 'LOCAL'] -('listings_latest',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('listings_latest',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time day ['METRIC_TIME'] -('listings_latest',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('listings_latest',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('listings_latest',) () user ['ENTITY', 'LOCAL'] ('listings_latest',) ("('listing',)", "('booking', 'listing')") approximate_continuous_booking_value_p99 ['JOINED', 'METRIC'] ('listings_latest',) ("('listing',)", "('booking', 'listing')") approximate_discrete_booking_value_p99 ['JOINED', 'METRIC'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure_multi_hop_model__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure_multi_hop_model__result0.txt index 5be5ef9f28..a1b58c75a5 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure_multi_hop_model__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_elements_for_measure_multi_hop_model__result0.txt @@ -5,19 +5,19 @@ docstring: --- Model Join-Path Entity Links Name Time Granularity Date Part Properties ------------------------------------------------------------- -------------------------------------- ---------------------- ------------------ ----------- ------------------------------------------- +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('account_month_txns',) () account_id ['ENTITY', 'LOCAL'] -('account_month_txns',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('account_month_txns',) () metric_time alien_day ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('account_month_txns',) () metric_time day ['METRIC_TIME'] -('account_month_txns',) () metric_time month ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('account_month_txns',) () metric_time quarter ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('account_month_txns',) () metric_time week ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] -('account_month_txns',) () metric_time year ['DERIVED_TIME_GRANULARITY', 'METRIC_TIME'] ('account_month_txns',) ("('account_id',)", "('account_id',)") txn_count ['JOINED', 'METRIC'] ('account_month_txns',) ('account_id',) account_month ['LOCAL'] ('account_month_txns',) ('account_id',) ds DAY ['DATE_PART', 'LOCAL'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_set_for_common_dimensions_in_different_models__result0.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_set_for_common_dimensions_in_different_models__result0.txt index 6b3fd5adfe..e310b00102 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_set_for_common_dimensions_in_different_models__result0.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_semantic_model_container.py/str/test_linkable_set_for_common_dimensions_in_different_models__result0.txt @@ -7,14 +7,13 @@ docstring: --- Model Join-Path Entity Links Name Time Granularity Date Part Properties --------------------------------------------------------- ------------------- -------------------- ------------------ ----------- ------------------------------------ +('__VIRTUAL__',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] +('__VIRTUAL__',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] ('bookings_source',) () listing ['ENTITY', 'LOCAL'] -('bookings_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('bookings_source',) () metric_time day ['METRIC_TIME'] ('bookings_source', 'listings_latest') ('listing',) capacity_latest ['JOINED'] ('bookings_source', 'listings_latest') ('listing',) country_latest ['JOINED'] ('bookings_source', 'listings_latest') ('listing',) created_at DAY ['DATE_PART', 'JOINED'] @@ -95,13 +94,6 @@ Model Join-Path Entity Links ('bookings_source', 'listings_latest', 'users_latest') ('listing', 'user') home_state_latest ['JOINED', 'MULTI_HOP'] ('bookings_source', 'lux_listing_mapping') ('listing',) lux_listing ['ENTITY', 'JOINED'] ('views_source',) () listing ['ENTITY', 'LOCAL'] -('views_source',) () metric_time DAY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOW ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time DOY ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time MONTH ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time QUARTER ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time YEAR ['DATE_PART', 'METRIC_TIME'] -('views_source',) () metric_time day ['METRIC_TIME'] ('views_source', 'listings_latest') ('listing',) capacity_latest ['JOINED'] ('views_source', 'listings_latest') ('listing',) country_latest ['JOINED'] ('views_source', 'listings_latest') ('listing',) created_at DAY ['DATE_PART', 'JOINED'] diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_derived_metrics_with_common_filtered_metric__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_derived_metrics_with_common_filtered_metric__result.txt index c56c93bb58..2a8d213f39 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_derived_metrics_with_common_filtered_metric__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_derived_metrics_with_common_filtered_metric__result.txt @@ -44,16 +44,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( @@ -116,16 +114,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_filter__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_filter__result.txt index 0988ab56dd..6681feeda2 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_filter__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_filter__result.txt @@ -43,33 +43,11 @@ FilterSpecResolutionLookUp( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=( - METRIC_TIME, - ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_input_filter__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_input_filter__result.txt index eb77de5f6a..46d7cab3f2 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_input_filter__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_invalid_metric_input_filter__result.txt @@ -43,33 +43,11 @@ FilterSpecResolutionLookUp( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=( - METRIC_TIME, - ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_filter__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_filter__result.txt index 235b7b5c02..bcce6cff12 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_filter__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_filter__result.txt @@ -40,16 +40,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_input_filter__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_input_filter__result.txt index 9a6a7f3ac5..ecf058e2ca 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_input_filter__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_resolution_for_valid_metric_input_filter__result.txt @@ -40,16 +40,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__accumulate_last_2_months_metric__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__accumulate_last_2_months_metric__result.txt index 8defd3f882..e22bb0084b 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__accumulate_last_2_months_metric__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__accumulate_last_2_months_metric__result.txt @@ -40,16 +40,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_different_parent_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_different_parent_time_grains__result.txt index 8e845ac586..d77ea9132f 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_different_parent_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_different_parent_time_grains__result.txt @@ -43,33 +43,11 @@ FilterSpecResolutionLookUp( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=( - METRIC_TIME, - ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_same_parent_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_same_parent_time_grains__result.txt index 0445feb36f..81f69c4a15 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_same_parent_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__derived_metric_with_same_parent_time_grains__result.txt @@ -40,16 +40,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_different_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_different_time_grains__result.txt index 45b2530eda..509a26139a 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_different_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_different_time_grains__result.txt @@ -46,33 +46,11 @@ FilterSpecResolutionLookUp( DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - element_name='metric_time', - dimension_type=TIME, - join_path=SemanticModelJoinPath( - left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), - ), - time_granularity=ExpandedTimeGranularity( - name='year', - base_granularity=YEAR, - ), - ), - LinkableDimension( - properties=( - METRIC_TIME, - ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='yearly_measure_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='yearly_measure_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_same_time_grains__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_same_time_grains__result.txt index 18673397df..f8501cc7ee 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_same_time_grains__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__metrics_with_same_time_grains__result.txt @@ -43,16 +43,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__simple_metric__result.txt b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__simple_metric__result.txt index 7b0e3fb8db..b5d29bd04e 100644 --- a/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__simple_metric__result.txt +++ b/metricflow-semantics/tests_metricflow_semantics/snapshots/test_spec_lookup.py/str/test_filter_spec_resolution__simple_metric__result.txt @@ -40,16 +40,14 @@ FilterSpecResolutionLookUp( ): ( LinkableDimension( properties=( + DERIVED_TIME_GRANULARITY, METRIC_TIME, ), - defined_in_semantic_model=SemanticModelReference( - semantic_model_name='monthly_measures_source', - ), element_name='metric_time', dimension_type=TIME, join_path=SemanticModelJoinPath( left_semantic_model_reference=SemanticModelReference( - semantic_model_name='monthly_measures_source', + semantic_model_name='__VIRTUAL__', ), ), time_granularity=ExpandedTimeGranularity( diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml index bdf347c5ec..495b1460f7 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml @@ -22,16 +22,14 @@ docstring: + - - - - + @@ -100,15 +98,15 @@ docstring: - - - + + + - + @@ -174,15 +172,15 @@ docstring: - - - + + + - + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml index 22b037b1ee..88cc591d32 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml @@ -22,16 +22,14 @@ docstring: + - - - - + @@ -71,16 +69,14 @@ docstring: + - - - - + @@ -130,15 +126,15 @@ docstring: - - - + + + - + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml index 2139b25564..20a205c6a0 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml @@ -22,16 +22,14 @@ docstring: + - - - - + @@ -74,16 +72,14 @@ docstring: + - - - - + @@ -132,15 +128,15 @@ docstring: - - - + + + - + @@ -278,16 +274,14 @@ docstring: + - - - - + @@ -335,15 +329,15 @@ docstring: - - - + + + - + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml index 3db4144c0d..84b71bf6b7 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml @@ -22,16 +22,14 @@ docstring: + - - - - + @@ -79,15 +77,15 @@ docstring: - - - + + + - + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml index 71d459f80a..3573a346a7 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml @@ -27,16 +27,14 @@ docstring: + - - - - + @@ -84,15 +82,15 @@ docstring: - - - + + + - + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml index c9e0d1580d..1832b7eb85 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml @@ -27,16 +27,14 @@ docstring: + - - - - + @@ -84,15 +82,15 @@ docstring: - - - + + + - +