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

remove top level meta attribute from SemanticModels #8766

Merged
merged 1 commit into from
Oct 4, 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/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