Skip to content

Commit

Permalink
remove top level meta attribute (#8766)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop authored Oct 4, 2023
1 parent eac13e3 commit c6ff3ab
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion .changes/unreleased/Features-20230929-170945.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Features
body: Add meta attribute to SemanticModels
body: Add meta attribute to SemanticModels config
time: 2023-09-29T17:09:45.0354-05:00
custom:
Author: emmyoop
Expand Down
1 change: 0 additions & 1 deletion core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,6 @@ class SemanticModel(GraphNode):
refs: List[RefArgs] = field(default_factory=list)
created_at: float = field(default_factory=lambda: time.time())
config: SemanticModelConfig = field(default_factory=SemanticModelConfig)
meta: Dict[str, Any] = field(default_factory=dict)
unrendered_config: Dict[str, Any] = field(default_factory=dict)
primary_entity: Optional[str] = None
group: Optional[str] = None
Expand Down
1 change: 0 additions & 1 deletion core/dbt/contracts/graph/unparsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ class UnparsedSemanticModel(dbtClassMixin):
name: str
model: str # looks like "ref(...)"
config: Dict[str, Any] = field(default_factory=dict)
meta: Dict[str, Any] = field(default_factory=dict)
description: Optional[str] = None
label: Optional[str] = None
defaults: Optional[Defaults] = None
Expand Down
6 changes: 0 additions & 6 deletions core/dbt/parser/schema_yaml_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,8 @@ def parse_semantic_model(self, unparsed: UnparsedSemanticModel):
config=config,
unrendered_config=unrendered_config,
group=config.group,
meta=unparsed.meta,
)

# If we have meta in the config, copy to node level, for backwards
# compatibility with earlier node-only config.
if "meta" in config and config["meta"]:
parsed.meta = config["meta"]

ctx = generate_parse_semantic_models(
parsed,
self.root_project,
Expand Down
6 changes: 0 additions & 6 deletions schemas/dbt/manifest/v11.json
Original file line number Diff line number Diff line change
Expand Up @@ -5641,12 +5641,6 @@
"config": {
"$ref": "#/$defs/SemanticModelConfig"
},
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"unrendered_config": {
"type": "object",
"propertyNames": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,4 @@ def test_meta_config(self, project):
assert sm_id in manifest.semantic_models
sm_node = manifest.semantic_models[sm_id]
meta_expected = {"my_meta": "testing", "my_other_meta": "testing more"}
assert sm_node.meta == meta_expected
assert sm_node.config.meta == meta_expected

0 comments on commit c6ff3ab

Please sign in to comment.