Skip to content

Commit bd28800

Browse files
committed
dbt fusion guide - add more details about upgrading from dbt-core
1 parent e6e8123 commit bd28800

1 file changed

Lines changed: 73 additions & 1 deletion

File tree

docs/oss/integrations/dbt-fusion.mdx

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,79 @@ title: "dbt fusion (Beta)"
77
Elemmentary OSS integrates with dbt-fusion, starting with version 0.20.
88
Fusion is a complete rewrite of the dbt engine, and provides many benefits, including enhanced performance and static analysis.
99

10-
For more details about dbt-fusion capabilities, installation guidelines and migration best practices, please consult the [dbt-fusion docs](https://docs.getdbt.com/docs/fusion/about-fusion).
10+
For more details about dbt-fusion capabilities please consult the [dbt-fusion docs](https://docs.getdbt.com/docs/fusion/about-fusion).
11+
12+
### Upgrading to dbt-fusion
13+
14+
As a part of the migration to dbt-fusion, it is required to remove deprecated syntax from various areas of the dbt project, and YAMLs in particular.
15+
Specifically for tests the following are important:
16+
17+
1. Test arguments must be encapsulated under an `arguments` field.
18+
2. Configuration fields such as `meta`, `tags` or `severity` must be encapsulated under a `config` field.
19+
3. Recommended (but not a must) - change the `tests` field to `data_tests` to conform with the current dbt guidelines.
20+
21+
Here's an example of an Elementary anomaly test with the old and new syntax:
22+
23+
<CodeGroup>
24+
25+
```yml Old syntax
26+
models:
27+
- name: login_events
28+
config:
29+
elementary:
30+
timestamp_column: "loaded_at"
31+
tests:
32+
- elementary.volume_anomalies:
33+
where_expression: "event_type in ('event_1', 'event_2') and country_name != 'unwanted country'"
34+
time_bucket:
35+
period: day
36+
count: 1
37+
tags: ["elementary"]
38+
severity: warn
39+
meta:
40+
owner: "@jessica.jones"
41+
42+
- name: users
43+
tests:
44+
- elementary.volume_anomalies:
45+
tags: ["elementary"]
46+
```
47+
48+
```yml New syntax
49+
models:
50+
- name: login_events
51+
config:
52+
elementary:
53+
timestamp_column: "loaded_at"
54+
data_tests:
55+
- elementary.volume_anomalies:
56+
arguments:
57+
where_expression: "event_type in ('event_1', 'event_2') and country_name != 'unwanted country'"
58+
time_bucket:
59+
period: day
60+
count: 1
61+
config:
62+
tags: ["elementary"]
63+
severity: warn
64+
meta:
65+
owner: "@jessica.jones"
66+
67+
- name: users
68+
data_tests:
69+
- elementary.volume_anomalies:
70+
config:
71+
tags: ["elementary"]
72+
```
73+
74+
</CodeGroup>
75+
76+
To facilitate the process of making these changes within your project, dbt introduced a tool called [dbt-autofix](https://github.com/dbt-labs/dbt-autofix) that
77+
can be used to automatically migrate your project to the new syntax.
78+
79+
Before running this tool, **please upgrade** to the most recent dbt-core version - as some of the syntax changes are not supported on older versions.
80+
81+
For full information on upgrading from dbt-core to dbt-fusion, please check [dbt-fusion's official upgrade guide](https://docs.getdbt.com/docs/dbt-versions/core-upgrade/upgrading-to-fusion).)
82+
1183
1284
### Supported Elementary capabilities
1385

0 commit comments

Comments
 (0)