Skip to content

Commit

Permalink
config for semantic models (#4221)
Browse files Browse the repository at this point in the history
related to: #3997

## What are you changing in this pull request and why?
- Add "Semantic models" tab for `config`
- Add a "Definition" header (like other similar pages, like
[`group`](https://docs.getdbt.com/reference/resource-configs/group),
[`enabled`](https://docs.getdbt.com/reference/resource-configs/enabled),
etc.)

## Other
- Added semantic models & metrics to
[#3957](#3957)

## 🎩 

### Previews
-
[1.6](https://docs-getdbt-com-git-dbeatty-semantic-models-config-dbt-labs.vercel.app/reference/resource-properties/config?version=1.6)
-
[1.7](https://docs-getdbt-com-git-dbeatty-semantic-models-config-dbt-labs.vercel.app/reference/resource-properties/config?version=1.7)

### v1.6

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/3bee360e-7709-4dde-9d5f-a81ce5095e96">

### v1.7

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/231c4b4b-e344-4757-ad93-50ec2d228e22">


## Checklist
- [x] I have tested that the code examples work
- [x] I have tested that the changes look correct in the Vercel preview
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.

---------

Co-authored-by: mirnawong1 <89008547+mirnawong1@users.noreply.github.com>
  • Loading branch information
dbeatty10 and mirnawong1 authored Nov 16, 2023
1 parent 2eec806 commit 520c5a2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions website/docs/reference/resource-properties/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ datatype: "{dictionary}"
{ label: 'Sources', value: 'sources', },
{ label: 'Metrics', value: 'metrics', },
{ label: 'Exposures', value: 'exposures', },
{ label: 'Semantic models', value: 'semantic models', },
]
}>

Expand Down Expand Up @@ -182,6 +183,36 @@ exposures:

</TabItem>

<TabItem value="semantic models">

<VersionBlock lastVersion="1.6">

Support for the `config` property on `semantic_models` was added in dbt Core v1.7

</VersionBlock>

<VersionBlock firstVersion="1.7">

<File name='models/<filename>.yml'>

```yml
version: 2
semantic_models:
- name: <semantic_model_name>
config:
enabled: true | false
group: <string>
meta: {dictionary}
```

</File>

</VersionBlock>

</TabItem>

</Tabs>

## Definition
The `config` property allows you to configure resources at the same time you're defining properties in YAML files.

0 comments on commit 520c5a2

Please sign in to comment.