-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mes-aides): integration aides permis velo #296
feat(mes-aides): integration aides permis velo #296
Conversation
937e9ea
to
d0b9fa4
Compare
d0b9fa4
to
61806d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1ère passe rapide :)
pipeline/dbt/models/staging/decoupage_administratif/_decoupage_administratif__models.yml
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/mes_aides/stg_mes_aides__permis_velo.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/mes_aides/garage/_mes_aides_garage__models.yml
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/mes_aides/garage/_mes_aides_garage__models.yml
Outdated
Show resolved
Hide resolved
...bt/models/intermediate/sources/mes_aides/permis_velo/int_mes_aides__services_permis_velo.sql
Outdated
Show resolved
Hide resolved
...bt/models/intermediate/sources/mes_aides/permis_velo/int_mes_aides__services_permis_velo.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/mes_aides/stg_mes_aides__permis_velo.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/mes_aides/stg_mes_aides__permis_velo.sql
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/mes_aides/stg_mes_aides__permis_velo.sql
Outdated
Show resolved
Hide resolved
.../models/intermediate/sources/mes_aides/permis_velo/int_mes_aides__structures_permis_velo.sql
Outdated
Show resolved
Hide resolved
1c66198
to
23eb6c5
Compare
23eb6c5
to
8cd30cc
Compare
8cd30cc
to
5e5c762
Compare
e382246
to
f96279b
Compare
f96279b
to
4c52f8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas grand chose à dire, c'est propre ✨ juste quelques renommages + quelques tests à ajouter pour bien dormir 😴
STRING_TO_ARRAY(data #>> '{fields,Liaisons Besoins}', ', ') AS "liaisons_besoins_mes_aides", | ||
data #>> '{fields,Slug Thématiques}' AS "slug_thematique_mes_aides", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STRING_TO_ARRAY(data #>> '{fields,Liaisons Besoins}', ', ') AS "liaisons_besoins_mes_aides", | |
data #>> '{fields,Slug Thématiques}' AS "slug_thematique_mes_aides", | |
STRING_TO_ARRAY(data #>> '{fields,Liaisons Besoins}', ', ') AS "liaisons_besoins", | |
data #>> '{fields,Slug Thématiques}' AS "slug_thematiques", |
data #>> '{fields,SIRET}' AS "siret_structure", | ||
data #>> '{fields,Slug Organisme}' AS "slug_organisme_structure", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data #>> '{fields,SIRET}' AS "siret_structure", | |
data #>> '{fields,Slug Organisme}' AS "slug_organisme_structure", | |
data #>> '{fields,SIRET}' AS "siret", | |
data #>> '{fields,Slug Organisme}' AS "slug_organisme", |
data #>> '{fields,Nom Organisme}' AS "nom_organisme_structure", | ||
data #>> '{fields,Organisme Type}' AS "typologie_structure", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data #>> '{fields,Nom Organisme}' AS "nom_organisme_structure", | |
data #>> '{fields,Organisme Type}' AS "typologie_structure", | |
data #>> '{fields,Nom Organisme}' AS "nom_organisme", | |
data #>> '{fields,Organisme Type}' AS "organisme_type", |
_di_source_id AS "_di_source_id", | ||
data #>> '{fields,ID}' AS "id", | ||
TRIM(SUBSTRING(data #>> '{fields,Liaisons Villes}' FROM '^(.*) \(')) AS "liaisons_ville_nom", | ||
TRIM(SUBSTRING(data #>> '{fields,Liaisons Villes}' FROM '\((\d+)\)$')) AS "liaisons_code_postal", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TRIM(SUBSTRING(data #>> '{fields,Liaisons Villes}' FROM '\((\d+)\)$')) AS "liaisons_code_postal", | |
TRIM(SUBSTRING(data #>> '{fields,Liaisons Villes}' FROM '\((\d+)\)$')) AS "liaisons_ville_code_postal", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reprends au maximum le nom des colonnes d'origine, ça facilite grandement la compréhension du mapping
WHEN LENGTH(permis_velo.description) > 280 THEN SUBSTRING(permis_velo.description FROM 1 FOR 277) || '...' | ||
ELSE permis_velo.description | ||
END AS "presentation_resume", | ||
permis_velo.description || COALESCE(E'\n\n' || permis_velo.bon_a_savoir, '') || COALESCE(E'\n\n' || permis_velo.modalite_versement, '') AS "presentation_detail", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attention cette ligne est hyper longue et ça dégrade la visilibité en PR sur GH ^
NULL AS "horaires_ouverture", | ||
NULL AS "accessibilite", | ||
CASE | ||
WHEN permis_velo.typologie_structure LIKE '%Mission locale%' THEN ARRAY['mission-locale'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insensible à la casse
WHEN permis_velo.typologie_structure LIKE '%Mission locale%' THEN ARRAY['mission-locale'] | |
WHEN permis_velo.typologie_structure ~* 'mission locale' THEN ARRAY['mission-locale'] |
- name: stg_mes_aides__garages | ||
- name: stg_mes_aides__permis_velo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
est-ce que tu pourrais ajouter quelques data_tests
? au minimum je dirais :
id
:not_null
,dbt_utils.not_empty_string
,unique
date_maj
:not_null
,not_constant
mais je pense que ça serait bien de faire quelques checks sur les valeurs prédéfinies. Par exemple, le champ type
contient Aide financière
, Prestation
et Accompagnement
et ton mapping en dépend. Si une de ces valeurs est renommée, ça sera complément silencieux, il n'y aura juste plus de valeur mappée.
Pour tester ça simplement, je dirais qu'il faut faire comme pour fredo : dans models/staging/sources/mes_aides/
voir models/staging/sources/mes_aides/permis_velo
tu crées des models supplémentaires où tu UNNEST
: stg_mes_aides__permis_velo__types
, etc. et là tu peux ajouter un data_test
de type accepted_values
.
(d'ailleurs je n'ai pas mis de tests pour les garages c'est dommage :))
230ce5c
to
0314344
Compare
...t/models/intermediate/sources/mes_aides/permis_velo/int_mes_aides__permis_velo__services.sql
Show resolved
Hide resolved
5dbfca5
to
56835c2
Compare
No description provided.