From bc60eaaef1c9742c6f5285408c53c20807e9b42a Mon Sep 17 00:00:00 2001 From: Patrick Yost Date: Thu, 19 Dec 2024 10:31:53 -0800 Subject: [PATCH] Add Tags to Semantic Layer Saved Queries Title says it all. Linked PRs: * the starting point at [dbt-semantic-interfaces](https://github.com/dbt-labs/dbt-semantic-interfaces/pull/366/files) * [dbt-core](https://github.com/dbt-labs/dbt-core/pull/10987) * [schemas.dbt.com](https://github.com/dbt-labs/schemas.getdbt.com/pull/75) Example of how this would look in an actual saved query in a yml file: ``` saved_queries: - name: with_list_tags_v2 tags: ['tag_b', 'tag_d', 'tag_a'] description: New customer orders by name and time query_params: metrics: - orders group_by: - Dimension('customer__customer_name') - TimeDimension('metric_time', 'day') where: - "{{ Dimension('customer__customer_type') }} = 'new'" exports: - name: new_customer_orders_table config: export_as: table - name: new_customer_orders_view config: export_as: view alias: new_customer_orders_export_alias testing: "what" breaking: 'break it now' ``` --- schemas/latest/dbt_yml_files-latest.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 6426910..987bde0 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -524,6 +524,19 @@ "additionalProperties": false } }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, "config": { "type": "object", "properties": {