Skip to content

Commit

Permalink
Use SemanticModelReference instead of SemanticModel
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jul 3, 2024
1 parent f6dca24 commit fe53fa1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
)
from dbt_semantic_interfaces.protocols import ProtocolHint
from dbt_semantic_interfaces.protocols.metric import Metric
from dbt_semantic_interfaces.protocols.semantic_model import SemanticModel
from dbt_semantic_interfaces.references import (
DimensionReference,
MetricReference,
SemanticModelReference,
TimeDimensionReference,
)
from dbt_semantic_interfaces.transformations.transform_rule import (
Expand All @@ -38,7 +38,7 @@ def transform_model(semantic_manifest: PydanticSemanticManifest) -> PydanticSema
continue

default_granularity = TimeGranularity.DAY
seen_agg_time_dimensions: Set[Tuple[SemanticModel, TimeDimensionReference]] = set()
seen_agg_time_dimensions: Set[Tuple[SemanticModelReference, TimeDimensionReference]] = set()

metric_index: Dict[MetricReference, Metric] = {
MetricReference(metric.name): metric for metric in semantic_manifest.metrics
Expand All @@ -59,7 +59,7 @@ def transform_model(semantic_manifest: PydanticSemanticManifest) -> PydanticSema
)
continue
# Time dims might have the same names across semantic models, so check model/name combo.
semantic_model_with_agg_time_dimension = (semantic_model, agg_time_dimension_ref)
semantic_model_with_agg_time_dimension = (semantic_model.reference, agg_time_dimension_ref)
if semantic_model_with_agg_time_dimension in seen_agg_time_dimensions:
continue
seen_agg_time_dimensions.add(semantic_model_with_agg_time_dimension)
Expand Down

0 comments on commit fe53fa1

Please sign in to comment.