Skip to content

Commit

Permalink
group config for semantic models (#4220)
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?
- Fix version blocks for other resource types
- Match the style for other resource types for
`models/semantic_models.yml`
- Fix code example in `dbt_project.yml` to refer to `semantic-models`
(since `semantic_models` won't work)
- Simplify the definition by removing an explicit listing of applicable
resource types
- rather than adding the missing ones (like seeds and semantic models)

## Other
- Opened an issue to standardize the order of code examples for
`dbt_project.yml` vs. `properties.yml`:
[#4417](#4417)
- Opened an issue to figure out: do analyses _really_ have a `group`
config?1
[#4416](#4416)
- Opened an issue to standardize on `<group_name>` instead of `finance`
in generic syntax examples
[#4418](#4418)

## 🎩

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

### v1.7

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/73ad131a-2ec2-4e90-b04a-d9ccd41cb18f">

## 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 f5dc116 + d54ad46 commit 3f5133c
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions website/docs/reference/resource-configs/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ Support for grouping models was added in dbt Core v1.5

<VersionBlock firstVersion="1.5">

</VersionBlock>

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

```yml
Expand Down Expand Up @@ -68,6 +66,8 @@ select ...

</File>

</VersionBlock>

</TabItem>

<TabItem value="seeds">
Expand All @@ -80,8 +80,6 @@ Support for grouping seeds was added in dbt Core v1.5

<VersionBlock firstVersion="1.5">

</VersionBlock>

<File name='dbt_project.yml'>

```yml
Expand All @@ -102,6 +100,8 @@ seeds:
</File>
</VersionBlock>
</TabItem>
Expand All @@ -115,8 +115,6 @@ Support for grouping snapshots was added in dbt Core v1.5
<VersionBlock firstVersion="1.5">
</VersionBlock>
<File name='dbt_project.yml'>
```yml
Expand All @@ -143,6 +141,8 @@ select ...

</File>

</VersionBlock>


</TabItem>

Expand All @@ -156,8 +156,6 @@ Support for grouping tests was added in dbt Core v1.5

<VersionBlock firstVersion="1.5">

</VersionBlock>

<File name='dbt_project.yml'>

```yml
Expand Down Expand Up @@ -210,6 +208,8 @@ select ...

</File>

</VersionBlock>

</TabItem>

<TabItem value="analyses">
Expand Down Expand Up @@ -239,8 +239,6 @@ Support for grouping metrics was added in dbt Core v1.5
<VersionBlock firstVersion="1.5">
</VersionBlock>
<File name='dbt_project.yml'>
```yaml
Expand All @@ -264,8 +262,11 @@ metrics:

</File>

</VersionBlock>

</TabItem>


<TabItem value="semantic models">

<VersionBlock lastVersion="1.6">
Expand All @@ -276,37 +277,35 @@ Support for grouping semantic models has been added in dbt Core v1.7.

<VersionBlock firstVersion="1.7">

<File name='schema.yml'>
<File name='models/semantic_models.yml'>

```yml
```yaml
semantic_models:
- name: model_name
group: finance
- name: <semantic_model_name>
group: <group_name>

```

</File>

<File name='dbt_project.yml'>

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

</VersionBlock>
</TabItem>
</Tabs>
## Definition
An optional configuration for grouping models, analysis, snapshots, tests, and metrics. When a resource is grouped, dbt will allow it to reference private models within the same group.
An optional configuration for assigning a group to a resource. When a resource is grouped, dbt will allow it to reference private models within the same group.
For more details on reference access between resources in groups, check out [model access](/docs/collaborate/govern/model-access#groups).
Expand Down

0 comments on commit 3f5133c

Please sign in to comment.