-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipeline) : integration of the imilo source (int))
int addition int additions int fix : add the necessary imilo annotations for quality + little bug in the int_quality_stats because - the iteration is not technically over (there still is imilo_offres_structures) - but the next one is not a qualifying source (no kind) so the iteration fails - switch to loop.first and prepend UNION ALL to avoid any further issue int additions
- Loading branch information
1 parent
109545e
commit 8350352
Showing
9 changed files
with
155 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
pipeline/dbt/models/intermediate/sources/imilo/_imilo__models.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: int_imilo__adresses | ||
data_tests: | ||
- check_adresse: | ||
config: | ||
severity: warn | ||
columns: | ||
- name: id | ||
data_tests: | ||
- unique | ||
- not_null | ||
|
||
- name: int_imilo__services | ||
data_tests: | ||
- check_service: | ||
config: | ||
severity: warn | ||
columns: | ||
- name: id | ||
data_tests: | ||
- unique | ||
- not_null | ||
- dbt_utils.not_empty_string | ||
- name: structure_id | ||
data_tests: | ||
- not_null | ||
- relationships: | ||
to: ref('int_imilo__structures') | ||
field: id | ||
|
||
- name: int_imilo__structures | ||
data_tests: | ||
- check_structure: | ||
config: | ||
severity: warn | ||
columns: | ||
- name: id | ||
data_tests: | ||
- unique | ||
- not_null | ||
- dbt_utils.not_empty_string | ||
- name: adresse_id | ||
data_tests: | ||
- not_null | ||
- relationships: | ||
to: ref('int_imilo__adresses') | ||
field: id |
19 changes: 19 additions & 0 deletions
19
pipeline/dbt/models/intermediate/sources/imilo/int_imilo__adresses.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
WITH structures AS ( | ||
SELECT * FROM {{ ref('stg_imilo__structures') }} | ||
), | ||
|
||
final AS ( | ||
SELECT | ||
id AS "id", | ||
commune AS "commune", | ||
code_postal AS "code_postal", | ||
code_insee AS "code_insee", | ||
adresse AS "adresse", | ||
complement_adresse AS "complement_adresse", | ||
CAST(NULL AS FLOAT) AS "longitude", | ||
CAST(NULL AS FLOAT) AS "latitude", | ||
_di_source_id AS "source" | ||
FROM structures | ||
) | ||
|
||
SELECT * FROM final |
44 changes: 44 additions & 0 deletions
44
pipeline/dbt/models/intermediate/sources/imilo/int_imilo__services.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
WITH services AS ( | ||
SELECT * FROM {{ ref('stg_imilo__offres') }} | ||
), | ||
|
||
final AS ( | ||
SELECT | ||
_di_source_id AS "source", | ||
structure_id AS "structure_id", | ||
NULL AS "courriel", | ||
CAST(NULL AS BOOLEAN) AS "cumulable", | ||
CAST(NULL AS BOOLEAN) AS "contact_public", | ||
NULL AS "contact_nom_prenom", | ||
CAST(date_maj AS DATE) AS "date_maj", | ||
CAST(date_creation AS DATE) AS "date_creation", | ||
NULL AS "formulaire_en_ligne", | ||
NULL AS "frais_autres", | ||
CAST(NULL AS TEXT []) AS "justificatifs", | ||
NULL AS "lien_source", | ||
CAST(NULL AS TEXT []) AS "modes_accueil", | ||
CAST(NULL AS TEXT []) AS "modes_orientation_accompagnateur", | ||
NULL AS "modes_orientation_accompagnateur_autres", | ||
ARRAY[modes_orientation_beneficiaire] AS "modes_orientation_beneficiaire", | ||
NULL AS "modes_orientation_beneficiaire_autres", | ||
nom AS "nom", | ||
NULL AS "page_web", | ||
NULL AS "presentation_detail", | ||
presentation_resume AS "presentation_resume", | ||
NULL AS "prise_rdv", | ||
ARRAY[profils] AS "profils", | ||
CAST(NULL AS TEXT []) AS "pre_requis", | ||
NULL AS "recurrence", | ||
ARRAY[thematiques] AS "thematiques", | ||
CAST(NULL AS TEXT []) AS "types", | ||
NULL AS "telephone", | ||
CAST(NULL AS TEXT []) AS "frais", | ||
NULL AS "zone_diffusion_type", | ||
NULL AS "zone_diffusion_code", | ||
NULL AS "zone_diffusion_nom", | ||
CAST(NULL AS DATE) AS "date_suspension", | ||
id AS "id" | ||
FROM services | ||
) | ||
|
||
SELECT * FROM final |
31 changes: 31 additions & 0 deletions
31
pipeline/dbt/models/intermediate/sources/imilo/int_imilo__structures.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
WITH structures AS ( | ||
SELECT * FROM {{ ref('stg_imilo__structures') }} | ||
), | ||
|
||
final AS ( | ||
SELECT | ||
_di_source_id AS "source", | ||
id AS "id", | ||
NULL AS "siret", | ||
NULL AS "rna", | ||
courriel AS "courriel", | ||
antenne AS "antenne", | ||
horaires_ouverture AS "horaires_ouverture", | ||
site_web AS "site_web", | ||
NULL AS "lien_source", | ||
NULL AS "accessibilite", | ||
telephone AS "telephone", | ||
typologie AS "typologie", | ||
nom AS "nom", | ||
ARRAY[labels_nationaux] AS "labels_nationaux", | ||
CAST(NULL AS TEXT []) AS "labels_autres", | ||
presentation_resume AS "presentation_resume", | ||
presentation_detail AS "presentation_detail", | ||
id AS "adresse_id", | ||
CAST(NULL AS TEXT []) AS "thematiques", | ||
CAST(date_maj AS DATE) AS "date_maj" | ||
FROM structures | ||
|
||
) | ||
|
||
SELECT * FROM final |