Skip to content

Commit

Permalink
chore(pipeline): remove a depricated FT service in the 69 department
Browse files Browse the repository at this point in the history
smarter test
  • Loading branch information
YannickPassa committed Nov 14, 2024
1 parent c083909 commit 0c61760
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ models:
- name: id
data_tests:
- unique
- not_null
- not_null:
config:
where: "nom NOT IN ('Bilan/Accompagnement mobilité') AND zone_diffusion_code NOT LIKE '69%'"
- dbt_utils.not_empty_string
- name: structure_id
data_tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ structures_with_commune AS (
LEFT JOIN adresses ON agences.id = adresses.id
),

excluded_ids AS (
SELECT structures.id || '-' || services.id AS id
FROM services
CROSS JOIN structures_with_commune AS structures
WHERE
services.nom = 'Bilan/Accompagnement mobilité'
AND structures.code_insee LIKE '69%'
),

final AS (
SELECT
services._di_source_id AS "source",
Expand Down Expand Up @@ -54,10 +63,12 @@ final AS (
structures.code_insee AS "zone_diffusion_code",
structures.commune AS "zone_diffusion_nom",
NULL AS "page_web",
CAST(NULL AS DATE) AS "date_suspension",
NULL::DATE AS "date_suspension",
structures.id || '-' || services.id AS "id"
FROM services
CROSS JOIN structures_with_commune AS structures
WHERE
structures.id || '-' || services.id NOT IN (SELECT excluded_ids.id FROM excluded_ids)
)

SELECT * FROM final

0 comments on commit 0c61760

Please sign in to comment.