-
Notifications
You must be signed in to change notification settings - Fork 5
Feat/nb_menages #197
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
base: main
Are you sure you want to change the base?
Feat/nb_menages #197
Conversation
…departement level. union all in gold layer.
wipgarden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @ThomGram @samibtorres,
Merci pour la PR, j'ai testé et les résultats m'ont l'air bon :)
J'ai quelques commentaires minimes concernant la doc principalement, et des micros suggestions, pas obligatoires.
Il y a juste un bloquant dans la couche bronze avec le référencement double de la vue créée - sauf erreur de ma part.
Je peux m'occuper d'appliquer des changements pour aider aussi en fonction de vos réponses.
Merci,
Juliette
|
|
||
| with population_nb_menages as ( | ||
| select | ||
| "CODGEO" as codgeo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je rajouterais l'année du code geo ici par sécurité, vu qu'ils changent annuellement - en plus du code et du type.
|
|
||
| with population_nb_menages_dept as ( | ||
| select | ||
| geo."CODDEP" as codgeo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je rajouterais l'année du code geo ici par sécurité, vu qu'ils changent annuellement - en plus du code et du type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonne idée, mais je ne trouve pas l'info de l'année du codgeo... je creuse
dbt_odis/models/silver/silver_population_menages_departement.sql
Outdated
Show resolved
Hide resolved
| - name: gold_population_nb_menages | ||
| description: Table contenant le nombre de ménages et le nombre moyen d'occupants par ménage à tous les niveaux géographiques (commune, département, région). Union des tables silver_population_menages, silver_population_menages_departement et silver_population_menages_region. | ||
| columns: | ||
| - name: codgeo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ajouter l'année du codegeo si suggestion acceptée
| SUM(pop."NPERC" * pop."NB") / nullif(SUM(pop."NB"),0) as nb_occ_Moyen, | ||
| 'DEP' as niveau_geo | ||
| from {{ ref('population_menages_2021') }} pop | ||
| inner join {{ ref('com_dep_reg') }} geo on pop."CODGEO" = geo."CODGEO" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour pousser le raisonnement il faudrait aussi faire la jointure sur l'année du codegeo - en l'ajoutant aussi dans com_dep_reg. Mais bon probablement overkill dans ce contexte :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Les codgeo de com_dep_reg sont mis à jour depuis l'api Melodi, je crois que l'api ne renvoit pas de champs concernant l'année malheureusement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut ajouter un test pour s'assurer que toutes les communes ont bien un codgeo dans com_dep_reg
Co-authored-by: Juliette <[email protected]>
…dgeo to a present day code geo. Added a test that fails if codgeo is missing or is an extra in silver population nb menages compared to com_dep_reg. Excluded COM and DROM as data seems missing. Modified nb menage silver layer to update codgeo to latest codgeo update. Updated docs.
|
Hello @wipgarden, J'ai ajouté un test: je vérifie que les codgeo soient identiques entre silver_population_menages et com_dep_reg. Ainsi, si des codgeo apparaissent ou disparaissent en 2026, il y aura une erreur. Le test exclu les COM et DROM, j'ai l'impression que les données ménages ne couvrent pas ces territoires. La doc est normalement à jour. N'hésite pas si j'ai oublié quelque chose ou si je manque de clarté. |
No description provided.