Repository navigation
feat(dbt): introduce fct_offres unified mart (D94) - #80
Merged
Merged
Conversation
Replace fct_offres_enrichies + fct_contexte_territorial (abandoned feature branch, D96) with a single wide fact table at the offres grain. Combines int_offres_analytiques (analytic shared layer, F1+F2+F5+F6) with three contextual sources via the snapshot pattern (D97): URSSAF effectifs density (LEFT JOIN on code_commune), BMO tension (LEFT JOIN on code_departement), URSSAF mass salary national benchmark (CROSS JOIN on a single post-filter row). Adds F3 windowed metrics (D100), F8 dbt audit (D103), F9 partitioning + clustering (D104). Carries D75 reliability metadata (statut_donnee, is_fiable_*, pct_couverture_*) precomputed for Looker dashboard consumption. Layout changes: fct_offres.sql now lives at the flat root of marts/ since a single mart resides there (consistent with D93 subfolder criterion); offres_enrichies/ subfolder removed; mart_contexte_- territorial.sql stub purged; YAML consolidated under _marts__models.yml. Empirical validation (Conv 3bis): 7 spot checks PASS, dbt build PASS=41 WARN=0 ERROR=0, zero corrective iteration triggered. Cardinality 1:1 preserved (10269 rows). Three pedagogical findings documented in cadrage-fct-offres.md: FT/Adzuna entreprise coverage inversion (31.47% vs 99.12%), top recruiters dominated by intermediaries/platforms (6/10), 'masquée' status empirical 2-case decomposition (544 unjoinable + 62 all-bassins-masked). Refs: D75, D94, D96, D97, D100, D103, D104 Closes: #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objectif
Fusion en un mart unifié
fct_offresau grain offre (D94) des deux marts initialement envisagés :fct_offres_enrichies(mergé) etfct_contexte_territorial(feature branch abandonnée, D96).Architecture
Pattern Kimball wide fact table sur BigQuery — table de présentation dénormalisée, une seule data source Looker, zéro blend. Le mart consomme
int_offres_analytiques(couche analytique partagée) + trois sources contextuelles en snapshot temporel (D97) :int_densite_sectorielle_commune— LEFT JOIN surcode_commune(URSSAF effectifs IT communaux)int_tensions_bassin_emploi— LEFT JOIN surcode_departement(tension BMO départementale)stg_urssaf__masse_salariale_na88— CROSS JOIN sur 1 ligne (benchmark salaire IT national)Apports
COUNT OVER+DENSE_RANK.dbt_loaded_at,dbt_invocation_id.date_creation, clustercategorie_metier, code_departement, source.statut_donnee,is_fiable_*,pct_couverture_*précalculées pour Looker.Layout
fct_offres.sqlà la racine plate demarts/(un seul modèle, critère D93). Suppression du sous-dossieroffres_enrichies/. Purge demart_contexte_territorial.sql(stub résiduel). Consolidation YAML sous_marts__models.yml. Fix #78 inclus : description deint_tensions_bassin_emploi.code_departementmise à jour (référencefct_offres).Validation empirique
statut_donnee, fenêtre entreprise 60j, rang volume commune.uv run dbt build --select fct_offres:PASS=41 WARN=0 ERROR=0.Découvertes empiriques documentées (
cadrage-fct-offres.md)'masquée': 544 offres non joinables + 62 dans départements tous bassins masqués.Décisions associées
D75, D93, D94, D96, D97, D100, D103, D104
Closes #78