Skip to content

Commit

Permalink
Semantic model configs (#4231)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Addresses issue #4180

## Checklist

- [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.
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  • Loading branch information
matthewshaver authored Oct 11, 2023
2 parents 14c632e + d7c5cb5 commit ba6e2a8
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 1 deletion.
32 changes: 31 additions & 1 deletion website/docs/reference/resource-configs/enabled.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ default_value: true
{ label: 'Sources', value: 'sources', },
{ label: 'Metrics', value: 'metrics', },
{ label: 'Exposures', value: 'exposures', },
{ label: 'Semantic models', value: 'semantic models', },
]
}>
<TabItem value="models">
Expand Down Expand Up @@ -250,10 +251,39 @@ exposures:

</TabItem>

<TabItem value="semantic models">

<VersionBlock lastVersion="1.6">

Support for disabling semantic models has been added in dbt Core v1.7

</VersionBlock>

<VersionBlock firstVersion="1.7">

<File name='semantic_models.yml'>

```yml
semantic_models:
- name: semantic_people
model: ref('people')
config:
enabled: false

```

</File>

The `enabled` configuration can be nested under the `config` key.

</VersionBlock>

</TabItem>

</Tabs>

## Definition
An optional configuration for disabling models, seeds, snapshots, and tests.
An optional configuration for disabling models, seeds, snapshots, tests, and semantic models.

* Default: true

Expand Down
38 changes: 38 additions & 0 deletions website/docs/reference/resource-configs/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This functionality is new in v1.5.
{ label: 'Tests', value: 'tests', },
{ label: 'Analyses', value: 'analyses', },
{ label: 'Metrics', value: 'metrics', },
{ label: 'Semantic models', value: 'semantic models', },
]
}>
<TabItem value="models">
Expand Down Expand Up @@ -265,6 +266,43 @@ metrics:

</TabItem>

<TabItem value="semantic models">

<VersionBlock lastVersion="1.6">

Support for grouping semantic models has been added in dbt Core v1.7.

</VersionBlock>

<VersionBlock firstVersion="1.7">

<File name='schema.yml'>

```yml
semantic_models:
- name: model_name
group: finance

```

</File>

<File name='dbt_project.yml'>

```yml
semantic_models:
[<resource-path>](resource-path):
+group: finance
```
</File>
The `group` configuration can be nested under the `config` key.

</VersionBlock>

</TabItem>

</Tabs>

## Definition
Expand Down
31 changes: 31 additions & 0 deletions website/docs/reference/resource-configs/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ default_value: {}
{ label: 'Tests', value: 'tests', },
{ label: 'Analyses', value: 'analyses', },
{ label: 'Macros', value: 'macros', },
{ label: 'Exposures', value: 'exposures', },
{ label: 'Semantic Models', value: 'semantic models', },
]
}>
<TabItem value="models">
Expand Down Expand Up @@ -172,6 +174,34 @@ exposures:

</TabItem>

<TabItem value="semantic models">

<VersionBlock lastVersion="1.6">

Support for grouping semantic models was added in dbt Core v1.7

</VersionBlock>

<VersionBlock firstVersion="1.7">

<File name='semantic_models.yml'>

```yml
semantic_models:
- name: semantic_people
model: ref('people')
config:
meta: {<dictionary>}

```
The `meta` configuration can be nusted under the `config` key.

</File>

</VersionBlock>

</TabItem>

</Tabs>

## Definition
Expand Down Expand Up @@ -248,3 +278,4 @@ select 1 as id
```

</File>

0 comments on commit ba6e2a8

Please sign in to comment.