Skip to content

Commit 5c71b73

Browse files
authored
move configs to models subfolder (#6868)
2 parents d5242db + 43d20cd commit 5c71b73

File tree

6 files changed

+77
-14
lines changed

6 files changed

+77
-14
lines changed

website/docs/reference/model-configs.md

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,35 @@ import ConfigGeneral from '/snippets/_config-description-general.md';
3030

3131
<File name='dbt_project.yml'>
3232

33+
<VersionBlock lastVersion="1.8">
34+
3335
```yaml
3436
models:
3537
[<resource-path>](/reference/resource-configs/resource-path):
3638
[+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): <materialization_name>
3739
[+](/reference/resource-configs/plus-prefix)[sql_header](/reference/resource-configs/sql_header): <string>
38-
[+](/reference/resource-configs/plus-prefix)[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail #only for materialized views on supported adapters
40+
[+](/reference/resource-configs/plus-prefix)[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail # Only for materialized views on supported adapters
3941
[+](/reference/resource-configs/plus-prefix)[unique_key](/reference/resource-configs/unique_key): <column_name_or_expression>
40-
4142
```
4243
44+
</VersionBlock>
4345
46+
<VersionBlock firstVersion="1.9">
47+
48+
```yaml
49+
models:
50+
[<resource-path>](/reference/resource-configs/resource-path):
51+
[+](/reference/resource-configs/plus-prefix)[materialized](/reference/resource-configs/materialized): <materialization_name>
52+
[+](/reference/resource-configs/plus-prefix)[sql_header](/reference/resource-configs/sql_header): <string>
53+
[+](/reference/resource-configs/plus-prefix)[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail # Only for materialized views on supported adapters
54+
[+](/reference/resource-configs/plus-prefix)[unique_key](/reference/resource-configs/unique_key): <column_name_or_expression>
55+
[+](/reference/resource-configs/plus-prefix)[batch_size](/reference/resource-configs/batch-size): day | hour | month | year
56+
[+](/reference/resource-configs/plus-prefix)[begin](/reference/resource-configs/begin): "<ISO formatted date or datetime (like, "2024-01-15T12:00:00Z")>"
57+
[+](/reference/resource-configs/plus-prefix)[lookback](/reference/resource-configs/lookback): <integer>
58+
[+](/reference/resource-configs/plus-prefix)[concurrent_batches](/reference/resource-properties/concurrent_batches): true | false
59+
```
60+
61+
</VersionBlock>
4462
</File>
4563
4664
</TabItem>
@@ -50,6 +68,8 @@ models:
5068
5169
<File name='models/properties.yml'>
5270
71+
<VersionBlock lastVersion="1.8">
72+
5373
```yaml
5474
version: 2
5575

@@ -58,20 +78,41 @@ models:
5878
config:
5979
[materialized](/reference/resource-configs/materialized): <materialization_name>
6080
[sql_header](/reference/resource-configs/sql_header): <string>
61-
[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail #only for materialized views on supported adapters
81+
[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail # Only for materialized views on supported adapters
6282
[unique_key](/reference/resource-configs/unique_key): <column_name_or_expression>
6383

6484
```
85+
</VersionBlock>
86+
87+
<VersionBlock firstVersion="1.9">
88+
89+
```yaml
90+
version: 2
91+
92+
models:
93+
- name: [<model-name>]
94+
config:
95+
[materialized](/reference/resource-configs/materialized): <materialization_name>
96+
[sql_header](/reference/resource-configs/sql_header): <string>
97+
[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail # Only for materialized views on supported adapters
98+
[unique_key](/reference/resource-configs/unique_key): <column_name_or_expression>
99+
[batch_size](/reference/resource-configs/batch-size): day | hour | month | year
100+
[begin](/reference/resource-configs/begin): "<ISO formatted date or datetime (like, "2024-01-15T12:00:00Z")>"
101+
[lookback](/reference/resource-configs/lookback): <integer>
102+
[concurrent_batches](/reference/resource-properties/concurrent_batches): true | false
65103

104+
```
105+
</VersionBlock>
66106
</File>
67107

68108
</TabItem>
69109

70-
71110
<TabItem value="config">
72111

73112
<File name='models/<model_name>.sql'>
74113

114+
<VersionBlock lastVersion="1.8">
115+
75116
```sql
76117

77118
{{ config(
@@ -82,6 +123,26 @@ models:
82123
) }}
83124

84125
```
126+
</VersionBlock>
127+
128+
<VersionBlock firstVersion="1.9">
129+
130+
```sql
131+
132+
{{ config(
133+
[materialized](/reference/resource-configs/materialized)="<materialization_name>",
134+
[sql_header](/reference/resource-configs/sql_header)="<string>"
135+
[on_configuration_change](/reference/resource-configs/on_configuration_change): apply | continue | fail # Only for materialized views for supported adapters
136+
[unique_key](/reference/resource-configs/unique_key)='column_name_or_expression'
137+
[batch_size](/reference/resource-configs/batch-size)='day' | 'hour' | 'month' | 'year'
138+
[begin](/reference/resource-configs/begin)="<ISO formatted date or datetime (like, "2024-01-15T12:00:00Z")>"
139+
[lookback](/reference/resource-configs/lookback)= <integer>
140+
[concurrent_batches](/reference/resource-properties/concurrent_batches)= true | false
141+
) }}
142+
143+
```
144+
145+
</VersionBlock>
85146

86147
</File>
87148

website/docs/reference/resource-configs/batch_size.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ datatype: hour | day | month | year
1111

1212
## Definition
1313

14-
The`batch_size` config determines how large batches are when running a microbatch. Accepted values are `hour`, `day`, `month`, or `year`. You can configure `batch_size` for a [model](/docs/build/models) in your `dbt_project.yml` file, property YAML file, or config block.
14+
The `batch_size` config determines how large batches are when running a [microbatch incremental model](/docs/build/incremental-microbatch). Accepted values are `hour`, `day`, `month`, or `year`. You can configure `batch_size` for a [model](/docs/build/models) in your `dbt_project.yml` file, property YAML file, or config block.
1515

1616
## Examples
1717

website/docs/reference/resource-configs/begin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ datatype: string
1111

1212
## Definition
1313

14-
Set the `begin` config to the timestamp value at which your microbatch model data should begin &mdash; at the point the data becomes relevant for the microbatch model. You can configure `begin` for a [model](/docs/build/models) in your `dbt_project.yml` file, property YAML file, or config block. The value for `begin` must be a string representing an ISO formatted date OR date and time.
14+
Set the `begin` config to the timestamp value at which your [microbatch incremental model](/docs/build/incremental-microbatch) data should begin &mdash; at the point the data becomes relevant for the microbatch model. You can configure `begin` for a [model](/docs/build/models) in your `dbt_project.yml` file, property YAML file, or config block. The value for `begin` must be a string representing an ISO-formatted date _or_ date and time.
1515

1616
## Examples
1717

website/docs/reference/resource-configs/lookback.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ title: "lookback"
33
id: "lookback"
44
sidebar_label: "lookback"
55
resource_types: [models]
6-
description: "dbt uses `lookback` to detrmine how many 'batches' of `batch_size` to reprocesses when a microbatch incremental model is running incrementally."
6+
description: "Configure `lookback` to determine how many 'batches' of `batch_size` to reprocess when a dbt microbatch incremental model runs incrementally"
77
datatype: int
88
---
99

1010
<VersionCallout version="1.9" />
1111
## Definition
1212

13-
Set the `lookback` to an integer greater than or equal to zero. The default value is `1`. You can configure `lookback` for a [model](/docs/build/models) in your `dbt_project.yml` file, property YAML file, or config block.
13+
Configure a `lookback` window to reprocess additional batches during [microbatch incremental model](/docs/build/incremental-microbatch) runs. It processes X batches up to the latest bookmark (the last successfully processed data point) to capture late-arriving records.
14+
15+
Set the `lookback` to an integer greater than or equal to zero. The default value is `1`. You can configure `lookback` for a [microbatch incremental model](/docs/build/incremental-microbatch) in your `dbt_project.yml` file, property YAML file, or config block.
1416

1517
## Examples
1618

website/docs/reference/resource-properties/concurrent_batches.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ models:
2323
</TabItem>
2424
2525
26-
<TabItem value="sql file">
26+
<TabItem value="Config block">
2727
2828
<File name='models/my_model.sql'>
2929
@@ -52,7 +52,7 @@ For more information, refer to [how batch execution works](/docs/build/increment
5252
## Example
5353

5454
By default, dbt auto-detects whether batches can run in parallel for microbatch models. However, you can override dbt's detection by setting the `concurrent_batches` config to `false` in your `dbt_project.yml` or model `.sql` file to specify parallel or sequential execution, given you meet these conditions:
55-
* You've configured a microbatch incremental strategy.
55+
* You've configured a [microbatch incremental strategy](/docs/build/incremental-microbatch).
5656
* You're working with cumulative metrics or any logic that depends on batch order.
5757

5858
Set `concurrent_batches` config to `false` to ensure batches are processed sequentially. For example:

website/sidebars.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,6 @@ const sidebarSettings = {
934934
"reference/advanced-config-usage",
935935
"reference/resource-configs/access",
936936
"reference/resource-configs/alias",
937-
"reference/resource-configs/batch-size",
938-
"reference/resource-configs/begin",
939937
"reference/resource-configs/contract",
940938
"reference/resource-configs/database",
941939
"reference/resource-configs/docs",
@@ -944,7 +942,6 @@ const sidebarSettings = {
944942
"reference/resource-configs/full_refresh",
945943
"reference/resource-configs/grants",
946944
"reference/resource-configs/group",
947-
"reference/resource-configs/lookback",
948945
"reference/resource-configs/meta",
949946
"reference/resource-configs/persist_docs",
950947
"reference/resource-configs/plus-prefix",
@@ -959,10 +956,13 @@ const sidebarSettings = {
959956
label: "For models",
960957
items: [
961958
"reference/model-properties",
962-
"reference/resource-properties/model_name",
963959
"reference/model-configs",
960+
"reference/resource-configs/batch-size",
961+
"reference/resource-configs/begin",
964962
"reference/resource-properties/concurrent_batches",
963+
"reference/resource-configs/lookback",
965964
"reference/resource-configs/materialized",
965+
"reference/resource-properties/model_name",
966966
"reference/resource-configs/on_configuration_change",
967967
"reference/resource-configs/sql_header",
968968
],

0 commit comments

Comments
 (0)