From 5ef454af92efa52b1b26d31880136bcce6d640c8 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Fri, 10 May 2024 16:53:57 -0700 Subject: [PATCH] Don't allow LinkableMetrics for case when entity reference is in entity links --- .../model/semantics/linkable_spec_resolver.py | 4 ++++ 1 file changed, 4 insertions(+) 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 b5173399d3..bfbea07e20 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py @@ -198,6 +198,10 @@ def __init__( ) for linkable_entities in linkable_element_set_for_metric.path_key_to_linkable_entities.values(): for linkable_entity in linkable_entities: + # TODO: some users encounter a situation in which the entity reference is in the entity links. Debug why. + if linkable_entity.reference in linkable_entity.entity_links: + logger.info(f"Found entity reference in entity links for linkable entity: {linkable_entity}") + continue metric_subquery_join_path_element = MetricSubqueryJoinPathElement( metric_reference=metric_reference, derived_from_semantic_models=defined_from_semantic_models,