Skip to content

Commit

Permalink
Make time spine model name a constant (#10363)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliceliu authored Jun 25, 2024
1 parent 11ee2b9 commit d936a63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/dbt/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
PACKAGE_LOCK_FILE_NAME = "package-lock.yml"
MANIFEST_FILE_NAME = "manifest.json"
SEMANTIC_MANIFEST_FILE_NAME = "semantic_manifest.json"
TIME_SPINE_MODEL_NAME = "metricflow_time_spine"
PARTIAL_PARSE_FILE_NAME = "partial_parse.msgpack"
PACKAGE_LOCK_HASH_KEY = "sha1_hash"
4 changes: 2 additions & 2 deletions core/dbt/contracts/graph/semantic_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SemanticManifestValidator,
)

from dbt.constants import TIME_SPINE_MODEL_NAME
from dbt.events.types import SemanticValidationFailure
from dbt.exceptions import ParsingError
from dbt_common.clients.system import write_file
Expand Down Expand Up @@ -82,8 +83,7 @@ def _get_pydantic_semantic_manifest(self) -> PydanticSemanticManifest:
# Look for time-spine table model and create time spine table configuration
if self.manifest.semantic_models:
# Get model for time_spine_table
time_spine_model_name = "metricflow_time_spine"
model = self.manifest.ref_lookup.find(time_spine_model_name, None, None, self.manifest)
model = self.manifest.ref_lookup.find(TIME_SPINE_MODEL_NAME, None, None, self.manifest)
if not model:
raise ParsingError(
"The semantic layer requires a 'metricflow_time_spine' model in the project, but none was found. "
Expand Down

0 comments on commit d936a63

Please sign in to comment.