Skip to content

Commit

Permalink
chore(pipeline) : Replace all "tests" by "data_tests"
Browse files Browse the repository at this point in the history
To get rid of a deprecation warning whenever we run `dbt test`.

https://docs.getdbt.com/docs/build/data-tests#new-data_tests-syntax

The command:

	git grep  --color=never --name-only "tests:"  pipeline/dbt/models
	| xargs -i% sed -i 's/tests:/data_tests:/g' %
  • Loading branch information
vperron committed Aug 5, 2024
1 parent 7c38210 commit f560da3
Show file tree
Hide file tree
Showing 33 changed files with 343 additions and 343 deletions.
6 changes: 3 additions & 3 deletions pipeline/dbt/models/intermediate/_models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ models:
* model can contain faulty data
* test failure are saved (see log output)
tests:
data_tests:
- check_adresse: *union-common-check-args

- name: int__union_services
Expand All @@ -23,7 +23,7 @@ models:
* model can contain faulty data
* test failure are saved (see log output)
tests:
data_tests:
- check_service: *union-common-check-args

- name: int__union_structures
Expand All @@ -32,7 +32,7 @@ models:
* model can contain faulty data
* test failure are saved (see log output)
tests:
data_tests:
- check_structure: *union-common-check-args

- name: int__plausible_personal_emails
Expand Down
6 changes: 3 additions & 3 deletions pipeline/dbt/models/intermediate/brevo/_brevo__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ models:
- name: int_brevo__contacts
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: courriel
tests:
data_tests:
- not_null
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: est_interdit
tests:
data_tests:
- not_null
- accepted_values:
values: [true, false]
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@ version: 2

models:
- name: int_action_logement__adresses
tests:
data_tests:
- check_adresse:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string

- name: int_action_logement__services
tests:
data_tests:
- check_service:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: structure_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_action_logement__structures')
field: id
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_action_logement__adresses')
field: id

- name: int_action_logement__structures
tests:
data_tests:
- check_structure:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_action_logement__adresses')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@ version: 2

models:
- name: int_agefiph__adresses
tests:
data_tests:
- check_adresse:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string

- name: int_agefiph__services
tests:
data_tests:
- check_service:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: structure_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_agefiph__structures')
field: id
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_agefiph__adresses')
field: id

- name: int_agefiph__structures
tests:
data_tests:
- check_structure:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_agefiph__adresses')
Expand Down
10 changes: 5 additions & 5 deletions pipeline/dbt/models/intermediate/sources/cd35/_cd35__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ version: 2

models:
- name: int_cd35__adresses
tests:
data_tests:
- check_adresse:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string

- name: int_cd35__structures
tests:
data_tests:
- check_structure:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_cd35__adresses')
Expand Down
18 changes: 9 additions & 9 deletions pipeline/dbt/models/intermediate/sources/cd72/_cd72__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@ version: 2

models:
- name: int_cd72__adresses
tests:
data_tests:
- check_adresse:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string

- name: int_cd72__services
tests:
data_tests:
- check_service:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: structure_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_cd72__structures')
field: id
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_cd72__adresses')
field: id

- name: int_cd72__structures
tests:
data_tests:
- check_structure:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_cd72__adresses')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@ version: 2

models:
- name: int_data_inclusion__adresses
tests:
data_tests:
- check_adresse:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string

- name: int_data_inclusion__services
tests:
data_tests:
- check_service:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: structure_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_data_inclusion__structures')
field: id
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_data_inclusion__adresses')
field: id

- name: int_data_inclusion__structures
tests:
data_tests:
- check_structure:
config:
severity: warn
columns:
- name: id
tests:
data_tests:
- unique
- not_null
- dbt_utils.not_empty_string
- name: adresse_id
tests:
data_tests:
- not_null
- relationships:
to: ref('int_data_inclusion__adresses')
Expand Down
Loading

0 comments on commit f560da3

Please sign in to comment.