Skip to content

Commit 5de72fb

Browse files
committed
Made the sampel project compatible with dbt-core v1.12.0
1 parent d28a623 commit 5de72fb

7 files changed

Lines changed: 47 additions & 18 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration variables
2-
VERSION=1.11.1
2+
VERSION=1.12.0
33
PROJ_DIR?=$(shell pwd)
44
VENV_DIR?=${PROJ_DIR}/.bldenv
55
BUILD_DIR=${PROJ_DIR}/build

dbt_adbs_test_project/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ dbt --version
2121

2222
```text
2323
Core:
24-
- installed: 1.3.0
25-
- latest: 1.3.0 - Up to date!
24+
- installed: 1.12.0
25+
- latest: 1.12.0 - Up to date!
2626
```
2727

2828
### Check database connectivity
@@ -32,7 +32,7 @@ dbt debug --profiles-dir ./
3232
```
3333

3434
```text
35-
dbt version: 1.3.0
35+
dbt version: 1.12.0
3636
python version: 3.8.13
3737
..
3838
..
@@ -65,12 +65,27 @@ After this, you can test various dbt features included in this project
6565
| Generic Test - Accepted values | `dbt test` | [schema.yml](./models/schema.yml)
6666
| Generic Test - Relationships | `dbt test` | [schema.yml](./models/schema.yml)
6767
| Operations | `dbt run-operation` | Check [macros](macros)
68+
| v1.12 ad hoc operation | `dbt run-operation --sql "select 1 from dual"` | Executes an Oracle statement without a macro |
69+
| v1.12 named selector composition | `dbt ls --select selector:sample_models` | [selectors.yml](selectors.yml) |
70+
| v1.12 downstream failure behavior | `dbt run -s sales_cost_incremental+` | `on_error: continue` in [properties.yml](models/properties.yml) |
6871
| Snapshots | `dbt snapshot` | Check [snapshots](snapshots)
6972
| Analyses | `dbt compile` | [eu_customers.sql](./analysis/eu_customers.sql)
7073
| Exposures | `dbt run` or `dbt test` | [exposures.yml](./models/exposures.yml)
7174
| Generate documentation | `dbt docs generate` |
7275
| Serve project documentation on port 8080 | `dbt docs serve`
7376

77+
## dbt Core v1.12 compatibility
78+
79+
The project uses the v1.12 generic-test `arguments` syntax and validates the
80+
new `run-operation --sql`, `selector:` selection method, and `on_error` model
81+
configuration. The opt-in v2 parser is not currently usable with `dbt-oracle`:
82+
the bundled experimental parser does not yet recognize the Oracle adapter.
83+
84+
`dbt_constraints` 1.0.9 is the latest supported package release, but its
85+
published macro documentation does not match its macro signatures. With dbt
86+
1.12's default macro-argument validation enabled, dbt therefore emits warnings
87+
for that dependency. They are not caused by this project's macros or schema.
88+
7489

7590
## Tests [TODO]
7691
- Metrics - Experimental feature introduced in dbt-core==1.0.0

dbt_adbs_test_project/models/properties.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ models:
33
- name: sales_cost_incremental
44
config:
55
post-hook: "SELECT COUNT(*) FROM sales_cost_incremental"
6+
# dbt Core v1.12: allow unrelated downstream branches to continue after a failure.
7+
on_error: continue

dbt_adbs_test_project/models/schema.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ models:
6060
- name: gender
6161
tests:
6262
- accepted_values:
63-
values: ['Male', 'Female']
63+
arguments:
64+
values: ['Male', 'Female']
6465
- name: countries
6566
columns:
6667
- name: country_id
@@ -73,10 +74,10 @@ models:
7374
- name: country_id
7475
tests:
7576
- relationships:
76-
to: ref('countries')
77-
field: country_id
77+
arguments:
78+
to: ref('countries')
79+
field: country_id
7880
- dbt_constraints.foreign_key:
79-
pk_table_name: ref('countries')
80-
pk_column_name: country_id
81-
82-
81+
arguments:
82+
pk_table_name: ref('countries')
83+
pk_column_name: country_id
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
packages:
2-
- package: dbt-labs/dbt_utils
3-
version: 0.8.6
4-
- package: Snowflake-Labs/dbt_constraints
5-
version: 0.4.2
6-
sha1_hash: 7664cb2e33183f39e86a72079d63607e43a50ad8
2+
- name: dbt_utils
3+
package: dbt-labs/dbt_utils
4+
version: 1.4.1
5+
- name: dbt_constraints
6+
package: Snowflake-Labs/dbt_constraints
7+
version: 1.0.9
8+
sha1_hash: b9f858fcf43fd74717c56899e55ceaf1c1789d10

dbt_adbs_test_project/packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
packages:
22
- package: dbt-labs/dbt_utils
3-
version: 0.8.6
3+
version: 1.4.1
44
- package: Snowflake-Labs/dbt_constraints
5-
version: [">=0.4.0", "<0.5.0"]
5+
version: 1.0.9
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
selectors:
2+
- name: sample_models
3+
description: Core sample models used for exercising the v1.12 selector method.
4+
definition:
5+
union:
6+
- method: fqn
7+
value: dbt_adbs_test_project.people
8+
- method: fqn
9+
value: dbt_adbs_test_project.eu.countries

0 commit comments

Comments
 (0)