From c82d0dd472d8e9f948106d6c138fdddf849b33d5 Mon Sep 17 00:00:00 2001 From: Victor Perron Date: Wed, 18 Sep 2024 17:00:12 +0200 Subject: [PATCH] chore(pipeline) : Switch to the new endpoints for France Travail All the pole-emploi.xxx endpoints will be shut down on September 30th. --- .../dags/dag_utils/sources/france_travail.py | 2 +- .../stg_france_travail__agences.sql | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pipeline/dags/dag_utils/sources/france_travail.py b/pipeline/dags/dag_utils/sources/france_travail.py index 6b853384e..d50ed64eb 100644 --- a/pipeline/dags/dag_utils/sources/france_travail.py +++ b/pipeline/dags/dag_utils/sources/france_travail.py @@ -10,7 +10,7 @@ def extract(url, token, id=None): client_id, client_secret = token.split(":") token = requests.post( - url="https://entreprise.pole-emploi.fr/connexion/oauth2/access_token", + url="https://entreprise.francetravail.fr/connexion/oauth2/access_token", params={ "realm": "/partenaire", }, diff --git a/pipeline/dbt/models/staging/sources/france_travail/stg_france_travail__agences.sql b/pipeline/dbt/models/staging/sources/france_travail/stg_france_travail__agences.sql index 064a8d12b..5ab5eed21 100644 --- a/pipeline/dbt/models/staging/sources/france_travail/stg_france_travail__agences.sql +++ b/pipeline/dbt/models/staging/sources/france_travail/stg_france_travail__agences.sql @@ -4,22 +4,22 @@ WITH source AS ( final AS ( SELECT - _di_source_id AS "_di_source_id", - CURRENT_DATE AS "date_maj", - CASE WHEN data ->> 'dispositifADEDA' = 'true' THEN 'https://www.pole-emploi.fr/actualites/a-laffiche/2022/adeda-un-dispositif-pour-mieux-a.html' END AS "accessibilite", - CAST(data #>> '{adressePrincipale,gpsLat}' AS FLOAT) AS "latitude", - CAST(data #>> '{adressePrincipale,gpsLon}' AS FLOAT) AS "longitude", - data #>> '{adressePrincipale,ligne4}' AS "adresse", - data #>> '{adressePrincipale,ligne3}' AS "complement_adresse", - data #>> '{adressePrincipale,communeImplantation}' AS "code_insee", - data #>> '{adressePrincipale,bureauDistributeur}' AS "code_postal", - data #>> '{contact,email}' AS "courriel", - data ->> 'horaires_open_street_map' AS "horaires_open_street_map", - data #>> '{contact,telephonePublic}' AS "telephone", - data ->> 'code' AS "id", - data ->> 'libelleEtendu' AS "nom", - data ->> 'siret' AS "siret", - data ->> 'type' AS "typologie" + _di_source_id AS "_di_source_id", + CURRENT_DATE AS "date_maj", + CASE WHEN data ->> 'dispositifADEDA' = 'true' THEN 'https://www.francetravail.fr/actualites/a-laffiche/2022/adeda-un-dispositif-pour-mieux-a.html' END AS "accessibilite", + CAST(data #>> '{adressePrincipale,gpsLat}' AS FLOAT) AS "latitude", + CAST(data #>> '{adressePrincipale,gpsLon}' AS FLOAT) AS "longitude", + data #>> '{adressePrincipale,ligne4}' AS "adresse", + data #>> '{adressePrincipale,ligne3}' AS "complement_adresse", + data #>> '{adressePrincipale,communeImplantation}' AS "code_insee", + data #>> '{adressePrincipale,bureauDistributeur}' AS "code_postal", + data #>> '{contact,email}' AS "courriel", + data ->> 'horaires_open_street_map' AS "horaires_open_street_map", + data #>> '{contact,telephonePublic}' AS "telephone", + data ->> 'code' AS "id", + data ->> 'libelleEtendu' AS "nom", + data ->> 'siret' AS "siret", + data ->> 'type' AS "typologie" FROM source )