Skip to content
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

chore(pipeline) : Corriger des coquilles pour la migration Pole Emploi -> France Travail #298

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pipeline/dags/dag_utils/sources/france_travail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
Loading