diff --git a/.changes/1.6.0/Under the Hood-20230612-070827.yaml b/.changes/1.6.0/Under the Hood-20230612-070827.yaml index 1c9dc80eb15..d51dfe3ec5b 100644 --- a/.changes/1.6.0/Under the Hood-20230612-070827.yaml +++ b/.changes/1.6.0/Under the Hood-20230612-070827.yaml @@ -1,5 +1,5 @@ kind: Under the Hood -body: Rm space from NodeType strings +body: Replace space with underscore in NodeType strings time: 2023-06-12T07:08:27.276551-04:00 custom: Author: jtcohen6 diff --git a/core/dbt/node_types.py b/core/dbt/node_types.py index 2af115d1b64..33d8fc4b0f4 100644 --- a/core/dbt/node_types.py +++ b/core/dbt/node_types.py @@ -26,14 +26,14 @@ class NodeType(StrEnum): Seed = "seed" # TODO: rm? RPCCall = "rpc" - SqlOperation = "sqloperation" + SqlOperation = "sql_operation" Documentation = "doc" Source = "source" Macro = "macro" Exposure = "exposure" Metric = "metric" Group = "group" - SemanticModel = "semanticmodel" + SemanticModel = "semantic_model" @classmethod def executable(cls) -> List["NodeType"]: diff --git a/tests/functional/semantic_models/test_semantic_model_parsing.py b/tests/functional/semantic_models/test_semantic_model_parsing.py index 149b609b75f..d88e95eec37 100644 --- a/tests/functional/semantic_models/test_semantic_model_parsing.py +++ b/tests/functional/semantic_models/test_semantic_model_parsing.py @@ -77,7 +77,7 @@ def test_semantic_model_parsing(self, project): assert isinstance(result.result, Manifest) manifest = result.result assert len(manifest.semantic_models) == 1 - semantic_model = manifest.semantic_models["semanticmodel.test.revenue"] + semantic_model = manifest.semantic_models["semantic_model.test.revenue"] assert semantic_model.node_relation.alias == "fct_revenue" assert ( semantic_model.node_relation.relation_name @@ -102,5 +102,5 @@ def test_semantic_model_partial_parsing(self, project): # Finally, verify that the manifest reflects the partially parsed change manifest = result.result - semantic_model = manifest.semantic_models["semanticmodel.test.revenue"] + semantic_model = manifest.semantic_models["semantic_model.test.revenue"] assert semantic_model.dimensions[0].type_params.time_granularity == TimeGranularity.WEEK diff --git a/tests/unit/test_node_types.py b/tests/unit/test_node_types.py index abe65d858c6..519922f6c76 100644 --- a/tests/unit/test_node_types.py +++ b/tests/unit/test_node_types.py @@ -9,14 +9,14 @@ NodeType.Operation: "operations", NodeType.Seed: "seeds", NodeType.RPCCall: "rpcs", - NodeType.SqlOperation: "sqloperations", + NodeType.SqlOperation: "sql_operations", NodeType.Documentation: "docs", NodeType.Source: "sources", NodeType.Macro: "macros", NodeType.Exposure: "exposures", NodeType.Metric: "metrics", NodeType.Group: "groups", - NodeType.SemanticModel: "semanticmodels", + NodeType.SemanticModel: "semantic_models", }