Skip to content

Commit

Permalink
Replace space with underscore in NodeType strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Jun 26, 2023
1 parent 9836f7b commit 125afed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .changes/1.6.0/Under the Hood-20230612-070827.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/node_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions tests/unit/test_node_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand Down

0 comments on commit 125afed

Please sign in to comment.