Skip to content

Commit

Permalink
Add Tags to Semantic Layer Saved Queries
Browse files Browse the repository at this point in the history
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](dbt-labs/dbt-core#10987)
* [schemas.dbt.com](dbt-labs/schemas.getdbt.com#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'
```
  • Loading branch information
theyostalservice committed Dec 19, 2024
1 parent 1dfd5cb commit bc60eaa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions schemas/latest/dbt_yml_files-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,19 @@
"additionalProperties": false
}
},
"tags": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
},
"config": {
"type": "object",
"properties": {
Expand Down

0 comments on commit bc60eaa

Please sign in to comment.