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
  • Loading branch information
YannickPassa committed Nov 14, 2024
1 parent c083909 commit e796cde
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ models:
- relationships:
to: ref('int_france_travail__adresses')
field: id
- name: zone_diffusion_code
data_tests:
- not_null:
config:
where: "nom IN ('Bilan/Accompagnement mobilité') AND zone_diffusion_code LIKE '69%'"

- name: int_france_travail__structures
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 e796cde

Please sign in to comment.