Skip to content

Commit

Permalink
test(dbt): change at_least_one to not_constant
Browse files Browse the repository at this point in the history
  • Loading branch information
vmttn committed Oct 9, 2023
1 parent dcc3742 commit 9f6e38e
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 91 deletions.
36 changes: 18 additions & 18 deletions pipeline/dbt/models/staging/sources/cd35/_cd35__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ models:
columns:
- name: adresse
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: code_insee
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: code_postal
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: commune
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: complement_adresse
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: courriel
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: date_creation
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: date_maj
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: horaires_ouvertures
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string:
config:
severity: warn
Expand All @@ -46,37 +46,37 @@ models:
- dbt_utils.not_empty_string
- name: latitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: lien_source
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: longitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: nom
tests:
- not_null
- dbt_utils.not_empty_string
- name: presentation_detail
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: profils
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: sigle
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: site_web
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: telephone
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: thematiques
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
87 changes: 43 additions & 44 deletions pipeline/dbt/models/staging/sources/dora/_dora__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ models:
columns:
- name: adresse
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: code_insee
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: code_postal
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: commune
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: complement_adresse
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: contact_nom
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: contact_prenom
tests:
- dbt_utils.at_least_one:
- dbt_utils.not_constant:
config:
severity: warn
- dbt_utils.not_empty_string
Expand All @@ -40,7 +40,7 @@ models:
values: [true, false]
- name: courriel
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: cumulable
tests:
Expand All @@ -52,7 +52,7 @@ models:
- not_null:
config:
severity: warn
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: date_maj
tests:
- not_null
Expand All @@ -62,14 +62,14 @@ models:
severity: warn
- name: date_suspension
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: formulaire_en_ligne
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: frais_autres
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: frais
tests:
Expand All @@ -84,17 +84,17 @@ models:
- dbt_utils.not_empty_string
- name: justificatifs
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: latitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: lien_source
tests:
- not_null
- dbt_utils.not_empty_string
- name: longitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: modes_accueil
tests:
- dbt_utils.expression_is_true:
Expand All @@ -105,20 +105,20 @@ models:
- dbt_utils.not_empty_string
- name: pre_requis
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: presentation_resume
tests:
- not_null
- dbt_utils.not_empty_string
- name: presentation_detail
tests:
- dbt_utils.at_least_one:
- dbt_utils.not_constant:
config:
severity: warn
- dbt_utils.not_empty_string
- name: prise_rdv
tests:
- dbt_utils.at_least_one:
- dbt_utils.not_constant:
config:
severity: warn
- dbt_utils.not_empty_string
Expand All @@ -130,11 +130,11 @@ models:
severity: warn
- name: recurrence
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: source
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: structure_id
tests:
Expand All @@ -148,7 +148,7 @@ models:
severity: warn
- name: telephone
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: thematiques
tests:
Expand All @@ -162,30 +162,30 @@ models:
expression: "<@ ARRAY(SELECT value FROM {{ ref('typologies_de_services') }})"
- name: zone_diffusion_code
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: zone_diffusion_nom
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: zone_diffusion_type
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- accepted_values:
values: [commune, epci, departement, region]

- name: stg_dora__structures
columns:
- name: accessibilite
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: adresse
tests:
- not_null:
config:
severity: warn
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: antenne
tests:
Expand All @@ -194,37 +194,37 @@ models:
values: [true, false]
- name: code_insee
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: code_postal
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: commune
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: complement_adresse
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: courriel
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: date_maj
tests:
- not_null:
config:
severity: warn
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.accepted_range:
min_value: "now() - interval '2 years'"
config:
severity: warn
- name: horaires_ouverture
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: id
tests:
Expand All @@ -240,32 +240,32 @@ models:
severity: warn
- name: latitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: lien_source
tests:
- not_null
- dbt_utils.not_empty_string
- name: longitude
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- name: nom
tests:
- not_null:
config:
severity: warn
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: presentation_detail
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: presentation_resume
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: rna
tests:
- dbt_utils.at_least_one:
- dbt_utils.not_constant:
config:
severity: warn
- dbt_utils.not_empty_string
Expand All @@ -274,19 +274,18 @@ models:
- not_null:
config:
severity: warn
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: site_web
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: source
tests:
- dbt_utils.at_least_one
- dbt_utils.not_empty_string
- name: telephone
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- dbt_utils.not_empty_string
- name: thematiques
tests:
Expand All @@ -295,7 +294,7 @@ models:
expression: "IS NULL"
- name: typologie
tests:
- dbt_utils.at_least_one
- dbt_utils.not_constant
- relationships:
to: ref('typologies_de_structures')
field: value
Loading

0 comments on commit 9f6e38e

Please sign in to comment.