From f4b919e4d4fbab3af673ee20304dd20c7a0646dc Mon Sep 17 00:00:00 2001 From: Victor Perron Date: Thu, 19 Sep 2024 09:14:21 +0200 Subject: [PATCH] chore(pipeline) : Convert 'PE' entities to 'FT' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some sources still transmit 'PE' types for their structures, which leads to those being discarded. Avant: data-inclusion=# select count(*) from public_dbt_test__audit.check_structure_int__union_structures__di_surrogate_id where value = 'PE'; -[ RECORD 1 ] count | 1146 Après: data-inclusion=# select count(*) from public_dbt_test__audit.check_structure_int__union_structures__di_surrogate_id where value = 'PE'; -[ RECORD 1 ] count | 0 --- .../int_emplois_de_linclusion__structures.sql | 5 ++++- .../int_mediation_numerique__structures.sql | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pipeline/dbt/models/intermediate/sources/emplois_de_linclusion/int_emplois_de_linclusion__structures.sql b/pipeline/dbt/models/intermediate/sources/emplois_de_linclusion/int_emplois_de_linclusion__structures.sql index 2163b5260..d848298a3 100644 --- a/pipeline/dbt/models/intermediate/sources/emplois_de_linclusion/int_emplois_de_linclusion__structures.sql +++ b/pipeline/dbt/models/intermediate/sources/emplois_de_linclusion/int_emplois_de_linclusion__structures.sql @@ -21,7 +21,10 @@ final AS ( labels_nationaux AS "labels_nationaux", labels_autres AS "labels_autres", thematiques AS "thematiques", - typologie AS "typologie", + CASE + WHEN typologie = 'PE' THEN 'FT' + ELSE typologie + END AS typologie, date_maj AS "date_maj", NULLIF(siret, '') AS "siret", NULLIF(nom, '') AS "nom", diff --git a/pipeline/dbt/models/intermediate/sources/mediation_numerique/int_mediation_numerique__structures.sql b/pipeline/dbt/models/intermediate/sources/mediation_numerique/int_mediation_numerique__structures.sql index 0f34491e6..4679adaf1 100644 --- a/pipeline/dbt/models/intermediate/sources/mediation_numerique/int_mediation_numerique__structures.sql +++ b/pipeline/dbt/models/intermediate/sources/mediation_numerique/int_mediation_numerique__structures.sql @@ -17,7 +17,10 @@ final AS ( accessibilite AS "accessibilite", labels_nationaux AS "labels_nationaux", thematiques AS "thematiques", - typologie AS "typologie", + CASE + WHEN typologie = 'PE' THEN 'FT' + ELSE typologie + END AS typologie, presentation_resume AS "presentation_resume", {{ truncate_text("presentation_detail") }} AS "presentation_detail", CAST(date_maj AS DATE) AS "date_maj",