Intermediate dbt
Mike Metzger
Data Engineer
dbt offers three kinds of tests
$$
unique
not_null
accepted_values
values: [a, b, c, d]
relationships
to: ref('table')
field: id
models/model_properties.yml
models/schema.yml
tests:
subheadingversion: 2
models:
- name: taxi_rides_raw
columns:
- name: tpep_pickup_datetime
tests:
- not_null
- name: payment_type
tests:
- not_null
- accepted_values:
values: [1, 2, 3, 4, 5, 6]
dbt test
dbt test --select modelname
target/compiled/projectname/models/model_properties.yml
directorytarget/compiled/nyc_yellow_taxi/models/model_properties.yml/
.sql
file (matching the failed test)dbt run
/ dbt test
Intermediate dbt