From 12e4506f3bb664e2bd573d8e17412d46c437b947 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 16 Jul 2024 15:17:54 -0700 Subject: [PATCH] Use DSI GroupByMetricReference --- .../model/semantics/linkable_element.py | 13 +------------ .../specs/group_by_metric_spec.py | 8 ++------ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py index 36757f508d..29fd9a0d64 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py @@ -12,7 +12,7 @@ from dbt_semantic_interfaces.references import ( DimensionReference, EntityReference, - LinkableElementReference, + GroupByMetricReference, MetricReference, SemanticModelReference, ) @@ -217,17 +217,6 @@ def semantic_model_origin(self) -> SemanticModelReference: return self.defined_in_semantic_model -# TODO: add to DSI -@dataclass(frozen=True) -class GroupByMetricReference(LinkableElementReference): - """Represents a group by metric. - - Different from MetricReference because it inherits linkable element attributes. - """ - - pass - - @dataclass(frozen=True) class LinkableMetric(LinkableElement, SerializableDataclass): """Describes how a metric can be realized by joining based on entity links.""" diff --git a/metricflow-semantics/metricflow_semantics/specs/group_by_metric_spec.py b/metricflow-semantics/metricflow_semantics/specs/group_by_metric_spec.py index fd46b6e622..bfb6d7629a 100644 --- a/metricflow-semantics/metricflow_semantics/specs/group_by_metric_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/group_by_metric_spec.py @@ -4,14 +4,10 @@ from typing import Any, Tuple from dbt_semantic_interfaces.dataclass_serialization import SerializableDataclass -from dbt_semantic_interfaces.references import EntityReference +from dbt_semantic_interfaces.references import EntityReference, GroupByMetricReference from typing_extensions import override -from metricflow_semantics.model.semantics.linkable_element import ( - ElementPathKey, - GroupByMetricReference, - LinkableElementType, -) +from metricflow_semantics.model.semantics.linkable_element import ElementPathKey, LinkableElementType from metricflow_semantics.naming.linkable_spec_name import StructuredLinkableSpecName from metricflow_semantics.specs.entity_spec import EntitySpec from metricflow_semantics.specs.instance_spec import InstanceSpecVisitor, LinkableInstanceSpec