Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace space with underscore in NodeType strings #7947

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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