Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 authored May 22, 2024
1 parent 098212d commit 6cc3de8
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ version: 2

models:
- name: model_name
data_tests:
tests:
- dbt_utils.equal_rowcount:
compare_model: ref('other_table_name')

Expand All @@ -105,7 +105,7 @@ version: 2

models:
- name: model_name
data_tests:
tests:
- dbt_utils.fewer_rows_than:
compare_model: ref('other_table_name')
```
Expand All @@ -124,13 +124,13 @@ version: 2
models:
# compare the entire table
- name: model_name
data_tests:
tests:
- dbt_utils.equality:
compare_model: ref('other_table_name')
# only compare some of the columns
- name: model_name_compare_columns
data_tests:
tests:
- dbt_utils.equality:
compare_model: ref('other_table_name')
compare_columns:
Expand All @@ -140,7 +140,7 @@ models:
# compare all columns except the ones on the ignore list
- name: model_name_exclude_columns
data_tests:
tests:
- dbt_utils.equality:
compare_model: ref('other_table_name')
exclude_columns:
Expand All @@ -163,7 +163,7 @@ version: 2
models:
- name: model_name
data_tests:
tests:
- dbt_utils.expression_is_true:
expression: "col_a + col_b = total"
```
Expand All @@ -178,7 +178,7 @@ version: 2
models:
- name: model_name
data_tests:
tests:
- dbt_utils.expression_is_true:
expression: "col_a + col_b = total"
config:
Expand All @@ -191,11 +191,11 @@ models:
- name: model_name
columns:
- name: col_a
data_tests:
tests:
- dbt_utils.expression_is_true:
expression: '>= 1'
- name: col_b
data_tests:
tests:
- dbt_utils.expression_is_true:
expression: '= 1'
config:
Expand All @@ -213,7 +213,7 @@ version: 2
models:
- name: model_name
data_tests:
tests:
- dbt_utils.recency:
datepart: day
field: created_at
Expand All @@ -234,7 +234,7 @@ models:
- name: model_name
columns:
- name: col_name
data_tests:
tests:
- dbt_utils.at_least_one
```

Expand All @@ -253,7 +253,7 @@ models:
- name: model_name
columns:
- name: column_name
data_tests:
tests:
- dbt_utils.not_constant
```

Expand All @@ -270,7 +270,7 @@ models:
- name: model_name
columns:
- name: column_name
data_tests:
tests:
- dbt_utils.not_empty_string
```

Expand All @@ -284,7 +284,7 @@ models:
- name: model_name
columns:
- name: column_name
data_tests:
tests:
- dbt_utils.not_empty_string:
trim_whitespace: false
Expand All @@ -303,7 +303,7 @@ models:
- name: model_name
columns:
- name: from_column
data_tests:
tests:
- dbt_utils.cardinality_equality:
field: other_column_name
to: ref('other_model_name')
Expand All @@ -323,7 +323,7 @@ models:
- name: my_model
columns:
- name: id
data_tests:
tests:
- dbt_utils.not_null_proportion:
at_least: 0.95
```
Expand All @@ -343,7 +343,7 @@ models:
- name: my_model
columns:
- name: city
data_tests:
tests:
- dbt_utils.not_accepted_values:
values: ['Barcelona', 'New York']
```
Expand All @@ -361,7 +361,7 @@ models:
- name: model_name
columns:
- name: id
data_tests:
tests:
- dbt_utils.relationships_where:
to: ref('other_model_name')
field: client_id
Expand All @@ -383,15 +383,15 @@ version: 2
models:
# test that age ranges do not overlap
- name: age_brackets
data_tests:
tests:
- dbt_utils.mutually_exclusive_ranges:
lower_bound_column: min_age
upper_bound_column: max_age
gaps: not_allowed
# test that each customer can only have one subscription at a time
- name: subscriptions
data_tests:
tests:
- dbt_utils.mutually_exclusive_ranges:
lower_bound_column: started_at
upper_bound_column: ended_at
Expand All @@ -400,7 +400,7 @@ models:
# test that each customer can have subscriptions that start and end on the same date
- name: subscriptions
data_tests:
tests:
- dbt_utils.mutually_exclusive_ranges:
lower_bound_column: started_at
upper_bound_column: ended_at
Expand Down Expand Up @@ -431,7 +431,7 @@ version: 2
models:
- name: subscriptions
data_tests:
tests:
- dbt_utils.mutually_exclusive_ranges:
lower_bound_column: coalesce(started_at, '1900-01-01')
upper_bound_column: coalesce(ended_at, '2099-12-31')
Expand Down Expand Up @@ -505,15 +505,15 @@ seeds:
- name: util_even_numbers
columns:
- name: i
data_tests:
tests:
- dbt_utils.sequential_values:
interval: 2
- name: util_hours
columns:
- name: date_hour
data_tests:
tests:
- dbt_utils.sequential_values:
interval: 1
datepart: 'hour'
Expand Down Expand Up @@ -545,7 +545,7 @@ case we recommend using this test instead.

```yaml
- name: revenue_by_product_by_month
data_tests:
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- month
Expand All @@ -556,7 +556,7 @@ An optional `quote_columns` argument (`default=false`) can also be used if a col

```yaml
- name: revenue_by_product_by_month
data_tests:
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- month
Expand All @@ -580,25 +580,25 @@ models:
- name: model_name
columns:
- name: user_id
data_tests:
tests:
- dbt_utils.accepted_range:
min_value: 0
inclusive: false
- name: account_created_at
data_tests:
tests:
- dbt_utils.accepted_range:
max_value: "getdate()"
#inclusive is true by default
- name: num_returned_orders
data_tests:
tests:
- dbt_utils.accepted_range:
min_value: 0
max_value: "num_orders"
- name: num_web_sessions
data_tests:
tests:
- dbt_utils.accepted_range:
min_value: 0
inclusive: false
Expand Down Expand Up @@ -631,7 +631,7 @@ To use this feature, the names of grouping variables can be passed as a list. Fo
- name: data_test_at_least_one
columns:
- name: field
data_tests:
tests:
- dbt_utils.at_least_one:
group_by_columns: ['customer_segment']
```
Expand Down

0 comments on commit 6cc3de8

Please sign in to comment.