Skip to content

Commit

Permalink
Prefix test name with package name
Browse files Browse the repository at this point in the history
  • Loading branch information
clrcrl committed Jun 29, 2020
1 parent c71ad23 commit 0ab2c5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Check [dbt Hub](https://hub.getdbt.com/fishtown-analytics/dbt_utils/latest/) for

## Macros
### Cross-database
While these macros are cross database, they do not support all databases.
These macros are provided to make date calculations easier and are not a core part of dbt.
Most date macros are not supported on postgres.
While these macros are cross database, they do not support all databases.
These macros are provided to make date calculations easier and are not a core part of dbt.
Most date macros are not supported on postgres.

#### current_timestamp ([source](macros/cross_db_utils/current_timestamp.sql))
This macro returns the current timestamp.
Expand Down Expand Up @@ -254,23 +254,31 @@ This test validates that there are no duplicate values present in a field for a

Usage:
```yaml
version: 2

models:
- name: my_model
columns:
- name: id
tests:
- unique_where:
where: "_deleted = false"
- name: id
tests:
- dbt_utils.unique_where:
where: "_deleted = false"
```
#### not_null_where ([source](macros/schema_tests/not_null_where.sql))
This test validates that there are no null values present in a column for a subset of rows by specifying a `where` clause.

Usage:
```yaml
version: 2
models:
- name: my_model
columns:
- name: id
tests:
- not_null_where:
where: "_deleted = false"
- name: id
tests:
- dbt_utils.not_null_where:
where: "_deleted = false"
```

#### relationships_where ([source](macros/schema_tests/relationships_where.sql))
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/models/schema_tests/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ models:
columns:
- name: id
tests:
- unique_where:
- dbt_utils.unique_where:
where: "_deleted = false"

- name: data_test_not_null_where
columns:
- name: id
tests:
- not_null_where:
- dbt_utils.not_null_where:
where: "_deleted = false"

- name: data_test_relationships_where_table_2
Expand Down

0 comments on commit 0ab2c5b

Please sign in to comment.