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

Nouveau calcul des recrutements #175

Merged
merged 4 commits into from
Oct 31, 2023
Merged

Nouveau calcul des recrutements #175

merged 4 commits into from
Oct 31, 2023

Conversation

laurinehu
Copy link
Contributor

**Carte Notion : ** https://www.notion.so/plateforme-inclusion/TB118-ReCr-er-des-indicateurs-recrutements-tels-que-d-finis-dans-l-ancien-TB-donn-es-de-l-IAE-e2b6a58266594154b976b59e5651a157?pvs=4

Pourquoi ?

Nouveau mode de calcul des recrutements en suivant les règles de calcul de l'ASP

Checks

  • J'ai lancé le modèle ou seed sur un dump local (si pertinent)
  • J'ai ajouté des tests à mon code Python, ou des assertions DBT sur le modèle SQL
  • J'ai documenté ce modèle voire certains de ses champs (usage métier, tableau de bord, etc)

@laurinehu laurinehu self-assigned this Oct 25, 2023
@laurinehu laurinehu marked this pull request as draft October 25, 2023 15:11
@laurinehu
Copy link
Contributor Author

laurinehu commented Oct 25, 2023

ToDo : ajout des propriétés structures (localisation etc) et salarié (genre etc) pour permettre le branchement des filtres

@laurinehu laurinehu force-pushed the laurinehu/recrutements branch 2 times, most recently from 7c57ee0 to 6cfd832 Compare October 27, 2023 06:33
@laurinehu laurinehu marked this pull request as ready for review October 30, 2023 07:59
@@ -71,7 +71,7 @@ models:
Vue créée pour joindre les dates d'embauche de chaque candidat. Cette vue est utilisée dans candidats_derniere_embauche.sql pour extraire la dernière date d'embauche d'un candidat.
- name: stg_salarie
description: >
Vue créée pour récupérer les id uniques des salarié(e)s ainsi que leur genre afin de permettre le calcul des ETPs par genre.
Copy link
Contributor

@YannickPassa YannickPassa Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aurais du rajouter un test qui compare le nombre de lignes de stg_salarie et salaries_V2. Est ce quetu pourras le faire stp ? :)

@laurinehu laurinehu changed the title new calculation of recrutements Nouveau calcul des recrutements Oct 30, 2023
@laurinehu laurinehu force-pushed the laurinehu/recrutements branch from d462ee7 to 7aca442 Compare October 30, 2023 15:38
end as salarie_brsa,
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree,
date_trunc('month', to_date(ctr.contrat_date_embauche, 'DD/MM/YYYY')) as mois_entree
from {{ source('fluxIAE', 'fluxIAE_ContratMission') }} as ctr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attention ici tu as pas pris le contrat V2 dans indexed

when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI'
else 'NON'
end as salarie_brsa,
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici je te conseille d'utiliser le seed ref_mesure_dispositif_asp.csv pour choper au passage le type de structure des emplois, ptet ça servira un jour

struct.structure_denomination,
struct.structure_adresse_admin_commune,
struct.structure_adresse_admin_code_insee,
app_geo.code_dept as departement_structure,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi tu ne prends pas directement le nom_departement de la colonne nom_departement de la table fluxIAE_Structure_v2 ? (pareil pour la région)

on ctr.contrat_id_pph = salarie.salarie_id
left join {{ source('fluxIAE', 'fluxIAE_RefNiveauFormation') }} as rnf
on ctr.contrat_niveau_de_formation_code = rnf.rnf_id
left join {{ source('fluxIAE', 'fluxIAE_Structure') }} as struct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prends autant que possible versions indexed

Copy link
Contributor

@YannickPassa YannickPassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Globalement ok, tu peux utiliser ça pour comparer les chiffres que tu obtiens avec ceux d'Elodie
Mais il manque/il faut modifier des colonnes (localisation en fonction de l'AF, colonnes localisation) et qques petits ajouts

@laurinehu laurinehu force-pushed the laurinehu/recrutements branch 2 times, most recently from b5de119 to d5c2e23 Compare October 31, 2023 11:15
) }}

select
/* l'ASP préconise l'utilisation de l'adresse administrative pour récupérer la commune de la structure */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu as bien vérifié que ça donne la même chose que l'ancienne version ?

{'columns': ['contrat_id_ctr', 'contrat_id_pph'], 'type' : 'btree', 'unique' : False},
]
) }}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ici je pense pas que tu sois obligée de faire des index vu que tu t'en sers nulle part pour des jointures.
TU peux la déplacer dans marts selon moi :)

when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI'
else 'NON'
end as salarie_brsa,
split_part(ctr.contrat_mesure_disp_code, '_', 1) as type_structure_entree,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu préfères faire ça que la jointure avec le seed ref_mesure_dispositif_asp.csv ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops non oubli merci !

Copy link
Contributor

@YannickPassa YannickPassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qques petits points a corriger selon moi mais ça me semble ok

@laurinehu laurinehu force-pushed the laurinehu/recrutements branch 2 times, most recently from 5edbdc6 to 79bf88c Compare October 31, 2023 14:03
@laurinehu laurinehu force-pushed the laurinehu/recrutements branch from f7e9157 to 4c3b02a Compare October 31, 2023 14:13
@laurinehu laurinehu merged commit dca8549 into main Oct 31, 2023
2 checks passed
@laurinehu laurinehu deleted the laurinehu/recrutements branch October 31, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants