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

Ajout du genre et du statut brsa dans la table sorties #405

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

YannickPassa
Copy link
Contributor

**Carte Notion : **

Pourquoi ?

Ajout du genre et du statut brsa dans la table sorties

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)

@YannickPassa YannickPassa self-assigned this Feb 12, 2025
@YannickPassa YannickPassa force-pushed the YannickPassa/sorties_rsa_sex branch from 8a0e4e5 to 620ed92 Compare February 12, 2025 13:34
@@ -29,10 +29,22 @@ select distinct
to_date(ctr.contrat_date_sortie_definitive, 'DD/MM/YYYY')
) || '-01-01')) as debut_annee_fin_contrat,
/* 0.0328767 = the value to convert days to months */
(rcrt.date_sortie_definitive::DATE - rcrt.date_recrutement::DATE) * (0.0328767) as duree_en_mois
(rcrt.date_sortie_definitive::DATE - rcrt.date_recrutement::DATE) * (0.0328767) as duree_en_mois,
Copy link
Contributor

Choose a reason for hiding this comment

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

/!\ MAGIC NUMBER ALERT /!
Si la valeur est reprise d'ailleurs afin que les chiffres collent alors ça serais bien de le mettre en commentaire pour éviter que quelqu'un passe et la change pour quelque chose de "mieux".

L'utilisation d'un float peux entraîner des erreurs de calcul, l'utilisation d'un decimal serait sans doute plus appropriée pour ne pas perdre en précision.

Vu que ça semble être du calendaire, peut-être que la fonction age() serait plus pertinente pour avoir le nombre de mois entre les deux dates 🤷.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Je me mets une carte pour corriger ça la semaine prochaine. Il me semble que j'avais testé avec age() à l'époque mais c'est tellement vieux que j'en ai plus aucune idée

Et pour le chiffre c'est juste qu'un jour = 0.0328767 mois !

Copy link
Contributor

Choose a reason for hiding this comment

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

Sauf les années bissextiles :P, mais donc pour ma culture vous considérez qu'1 an fait toujours 365 jours tout le temps ? Ou ça peux dépendre ?
Je demande car on a ces même gens de considération dans les emplois donc si tout le monde faite pareil c'est tant mieux :D.

Comment on lines 34 to 35
when ctr.contrat_salarie_rsa = 'OUI-M' then 'OUI'
when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI'
Copy link
Contributor

Choose a reason for hiding this comment

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

Pas testé, mais ça marcherais pas ça ?

Suggested change
when ctr.contrat_salarie_rsa = 'OUI-M' then 'OUI'
when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI'
when ctr.contrat_salarie_rsa in ('OUI-M', 'OUI-NM') then 'OUI'

Ou éventuellement

Suggested change
when ctr.contrat_salarie_rsa = 'OUI-M' then 'OUI'
when ctr.contrat_salarie_rsa = 'OUI-NM' then 'OUI'
when ctr.contrat_salarie_rsa ^@ 'OUI-' then 'OUI' -- ^@ == starts_with()

@YannickPassa YannickPassa force-pushed the YannickPassa/sorties_rsa_sex branch from 620ed92 to 2ec71ee Compare February 12, 2025 14:27
@YannickPassa YannickPassa added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit f166763 Feb 12, 2025
5 checks passed
@YannickPassa YannickPassa deleted the YannickPassa/sorties_rsa_sex branch February 12, 2025 15:31
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