From c6ff3abecd390788f2d29fd7d5d2338fa1ab8bb2 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Wed, 4 Oct 2023 13:23:09 -0500 Subject: [PATCH] remove top level meta attribute (#8766) --- .changes/unreleased/Features-20230929-170945.yaml | 2 +- core/dbt/contracts/graph/nodes.py | 1 - core/dbt/contracts/graph/unparsed.py | 1 - core/dbt/parser/schema_yaml_readers.py | 6 ------ schemas/dbt/manifest/v11.json | 6 ------ .../semantic_models/test_semantic_model_configs.py | 1 - 6 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.changes/unreleased/Features-20230929-170945.yaml b/.changes/unreleased/Features-20230929-170945.yaml index 3497b2f5246..92a2ce484d1 100644 --- a/.changes/unreleased/Features-20230929-170945.yaml +++ b/.changes/unreleased/Features-20230929-170945.yaml @@ -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 diff --git a/core/dbt/contracts/graph/nodes.py b/core/dbt/contracts/graph/nodes.py index 57a6043e49d..065a60a6d33 100644 --- a/core/dbt/contracts/graph/nodes.py +++ b/core/dbt/contracts/graph/nodes.py @@ -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 diff --git a/core/dbt/contracts/graph/unparsed.py b/core/dbt/contracts/graph/unparsed.py index df8149982f5..d06b13faa03 100644 --- a/core/dbt/contracts/graph/unparsed.py +++ b/core/dbt/contracts/graph/unparsed.py @@ -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 diff --git a/core/dbt/parser/schema_yaml_readers.py b/core/dbt/parser/schema_yaml_readers.py index 2e357bbbe8e..167175b4dcd 100644 --- a/core/dbt/parser/schema_yaml_readers.py +++ b/core/dbt/parser/schema_yaml_readers.py @@ -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, diff --git a/schemas/dbt/manifest/v11.json b/schemas/dbt/manifest/v11.json index 18047ef5135..aafbab125d3 100644 --- a/schemas/dbt/manifest/v11.json +++ b/schemas/dbt/manifest/v11.json @@ -5641,12 +5641,6 @@ "config": { "$ref": "#/$defs/SemanticModelConfig" }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "unrendered_config": { "type": "object", "propertyNames": { diff --git a/tests/functional/semantic_models/test_semantic_model_configs.py b/tests/functional/semantic_models/test_semantic_model_configs.py index 5938b1040c3..bd74ad95edd 100644 --- a/tests/functional/semantic_models/test_semantic_model_configs.py +++ b/tests/functional/semantic_models/test_semantic_model_configs.py @@ -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