Skip to content

Instantly share code, notes, and snippets.

@zoltanctoth
Created September 22, 2022 09:27
Show Gist options
  • Save zoltanctoth/4e29603849b7282e60941826cc74b552 to your computer and use it in GitHub Desktop.
Save zoltanctoth/4e29603849b7282e60941826cc74b552 to your computer and use it in GitHub Desktop.
An example of using dbt-expectations in practice. Check out the original file at https://github.com/nordquant/complete-dbt-bootcamp-zero-to-hero/blob/main/models/schema.yml#L56
models:
- name: dim_listings_w_hosts
tests:
- dbt_expectations.expect_table_row_count_to_equal_other_table:
compare_model: source('airbnb', 'listings')
columns:
- name: price
tests:
- dbt_expectations.expect_column_values_to_be_of_type:
column_type: number
- dbt_expectations.expect_column_quantile_values_to_be_between:
quantile: .99
min_value: 50
max_value: 500
- dbt_expectations.expect_column_max_to_be_between:
max_value: 5000
config:
severity: warn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment