From 876f83af020ef8851692cf21a8745bf7840244ea Mon Sep 17 00:00:00 2001 From: Pratik Bothra Date: Thu, 25 May 2023 22:03:35 +0100 Subject: [PATCH 1/3] Add support for metadata --- README.md | 1 + macros/query_comment.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 99c3c06..2c8dc42 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ An example query comment contains: "node_id": "model.my_project.model_a", "node_resource_type": "model", "node_tags": ["tag_1", "tag_2"], + "node_meta": {"owner": "@alice", "model_maturity": "in dev"}, "materialized": "incremental", -- dbt Cloud only diff --git a/macros/query_comment.sql b/macros/query_comment.sql index 49d28a5..c7ba22a 100644 --- a/macros/query_comment.sql +++ b/macros/query_comment.sql @@ -21,6 +21,7 @@ node_schema=node.schema, node_id=node.unique_id, node_resource_type=node.resource_type, + node_meta=node.config.meta, node_tags=node.tags, ) -%} From 9423a601b48a45564250d48074c57cc3eeff7401 Mon Sep 17 00:00:00 2001 From: Pratik Bothra Date: Thu, 25 May 2023 22:13:42 +0100 Subject: [PATCH 2/3] Add meta to test project model --- .../models/materialized_table.sql | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/integration_test_project/models/materialized_table.sql b/integration_test_project/models/materialized_table.sql index 259941e..af11a9f 100644 --- a/integration_test_project/models/materialized_table.sql +++ b/integration_test_project/models/materialized_table.sql @@ -1,3 +1,12 @@ -{{ config(materialized='table', tags='a') }} +{{ + config( + meta={ + "owner": "@alice", + "model_maturity": "in dev" + }, + materialized="table", + tags='a' + ) +}} select 1 as a From ae358756718460aa1452f1833e22a17baa6836a7 Mon Sep 17 00:00:00 2001 From: Pratik Bothra Date: Thu, 25 May 2023 22:16:27 +0100 Subject: [PATCH 3/3] Add changelog --- .changes/unreleased/Features-20230525-221550.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Features-20230525-221550.yaml diff --git a/.changes/unreleased/Features-20230525-221550.yaml b/.changes/unreleased/Features-20230525-221550.yaml new file mode 100644 index 0000000..01b8f57 --- /dev/null +++ b/.changes/unreleased/Features-20230525-221550.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Add dbt meta to comment metadata +time: 2023-05-25T22:15:50.19853+01:00 +custom: + Author: pratik60 + PR: "13"