From 783f1e366d5489e587dbaf3fb7494bcb75f4bf59 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 5 Sep 2024 10:36:53 -0700 Subject: [PATCH] Restrict custom granularities from having the same names as semantic models, too --- dbt_semantic_interfaces/validations/unique_valid_name.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbt_semantic_interfaces/validations/unique_valid_name.py b/dbt_semantic_interfaces/validations/unique_valid_name.py index 13a8c7e9..0da650ce 100644 --- a/dbt_semantic_interfaces/validations/unique_valid_name.py +++ b/dbt_semantic_interfaces/validations/unique_valid_name.py @@ -174,6 +174,10 @@ def _validate_semantic_model_elements_and_time_spines(semantic_manifest: Semanti for metric in semantic_manifest.metrics: custom_granularity_restricted_names_and_types[metric.name] = SemanticManifestNodeType.METRIC.value + for semantic_model in semantic_manifest.semantic_models: + custom_granularity_restricted_names_and_types[semantic_model.name] = ( + SemanticManifestNodeType.SEMANTIC_MODEL.value + ) # Verify custom granularity names are unique across relevant elements seen_custom_granularity_names: Set[str] = set()