Skip to content

Commit

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

## What are you changing in this pull request and why?
- Add an example for config in `dbt_project.yml`
- Match the style for other resource types for
`models/semantic_models.yml`
- Simplify the definition by removing the explicit listing of applicable
resource types
- rather than bring it up-to-date by adding sources, metrics, and
exposures

## 🎩 

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

### v1.7

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/c63a2128-77c6-48ec-b498-76e1e5f6d02b">

## 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.
  • Loading branch information
matthewshaver authored Nov 8, 2023
2 parents 3f5133c + 3c7a1bd commit 4e63205
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions website/docs/reference/resource-configs/enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,20 +261,26 @@ Support for disabling semantic models has been added in dbt Core v1.7

<VersionBlock firstVersion="1.7">

<File name='semantic_models.yml'>

```yml
semantic_models:
- name: semantic_people
model: ref('people')
config:
enabled: false
<File name='dbt_project.yml'>

```yaml
semantic-models:
[<resource-path>](/reference/resource-configs/resource-path):
[+](/reference/resource-configs/plus-prefix)enabled: true | false
```
</File>
The `enabled` configuration can be nested under the `config` key.
<File name='models/semantic_models.yml'>
```yaml
semantic_models:
- name: [<semantic_model_name>]
[config](/reference/resource-properties/config):
enabled: true | false
```
</File>
</VersionBlock>
Expand All @@ -283,7 +289,7 @@ The `enabled` configuration can be nested under the `config` key.
</Tabs>
## Definition
An optional configuration for disabling models, seeds, snapshots, tests, and semantic models.
An optional configuration for enabling or disabling a resource.
* Default: true
Expand Down

0 comments on commit 4e63205

Please sign in to comment.