-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbt_project.yml
More file actions
111 lines (104 loc) · 4.58 KB
/
Copy pathdbt_project.yml
File metadata and controls
111 lines (104 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: 'uk_property_analytics'
version: '0.1.0'
config-version: 2
# Profile name in profiles.yml — keep in sync with profiles.yml.example
profile: 'uk_property_analytics'
# Source paths
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
# Build artifact paths (gitignored)
target-path: "target"
clean-targets:
- "target"
- "dbt_packages"
- "logs"
# Analysis window. Update these when adding a complete new Land Registry year.
vars:
landreg_start_year: 2021
landreg_end_year: 2025
# Decision-support: minimum latest-year sales for an area's median sale price
# to be treated as reliable rather than indicative. Guards small-sample
# medians (e.g. a £13M area median derived from 2 prime-central sales).
min_reliable_sale_sample: 5
# Geography source. 'fixture' uses the tiny committed ref_onspd_sample seed
# (CI-safe, reproducible). 'onspd' uses the full national lookup loaded by
# scripts/load_geography.py into raw_geo.onspd_postcodes. Override locally:
# dbt build --vars 'geo_source: onspd'
geo_source: 'fixture'
# Minimum % of Land Registry rows (that have a postcode) which must map to an
# MSOA when building against the real ONSPD lookup. Enforced by
# tests/assert_landreg_postcode_coverage.sql (no-op on fixture builds).
min_postcode_coverage_pct: 95
# Default net monthly household income (GBP) for the area profile's
# affordability_ratio (= official rent / this income) until the app supplies a
# real user budget. A ratio above ~0.30 means rent exceeds the common 30%
# affordability guideline for this scenario.
default_monthly_net_income_gbp: 2500
# EPC source. 'fixture' uses the tiny committed ref_epc_sample seed (CI-safe);
# 'bulk' uses the full England & Wales certificates loaded by
# scripts/load_epc.py into raw_epc.certificates. Override locally:
# dbt build --vars 'epc_source: bulk'
epc_source: 'fixture'
# Crime source. 'fixture' uses the committed ref_crime_sample seed (CI-safe);
# 'bulk' uses police street-level crime loaded by scripts/load_crime.py into
# police.street_crime. Override locally: dbt build --vars 'crime_source: bulk'
crime_source: 'fixture'
# Planning/flood constraints source. 'fixture' uses the committed
# ref_area_constraints_sample seed (CI-safe); 'computed' uses the per-MSOA
# table loaded by scripts/load_constraints.py from the spatial roll-up in
# scripts/prepare_area_constraints.py. Override: --vars 'constraints_source: computed'
constraints_source: 'fixture'
# Amenity/convenience source. 'fixture' uses the committed
# ref_amenity_access_sample seed (CI-safe); 'computed' uses the per-MSOA
# access table loaded by scripts/load_amenities.py from the OpenStreetMap
# roll-up in scripts/prepare_amenity_access.py. Override: --vars 'amenities_source: computed'
amenities_source: 'fixture'
# Walking radius (km) for the walkable_amenity_count convenience measure.
walkable_radius_km: 1.0
# Default component weights for rpt_neighbourhood_score's overall_score. These
# are the neutral defaults baked into the mart; the app re-weights per user
# from the stored component scores without changing them. Any non-negative
# numbers work (they are normalised over the components an area actually has).
score_weight_affordability: 1.0
score_weight_safety: 1.0
score_weight_energy: 1.0
score_weight_flood: 1.0
score_weight_convenience: 1.0
# Canonical v2 contract range. validated_score_weight rejects model vars
# outside this range at compile time rather than silently accepting them.
score_weight_min: 0.0
score_weight_max: 5.0
# Default model materialisations by folder.
# - staging: views (cheap, recompute on every run)
# - intermediate: ephemeral by default (compose into marts)
# - marts: tables (consumed by dashboard, lineage tests)
models:
uk_property_analytics:
staging:
+materialized: view
+schema: staging
+description: "Light type casting + renaming. No business logic."
intermediate:
+materialized: ephemeral
+schema: intermediate
+description: "Joins and computed columns that compose into marts."
marts:
+materialized: table
+schema: marts
+description: "Dimensions, facts, and reporting marts. Consumed by the dashboard."
core:
+schema: core
analytics:
+schema: analytics
decision:
+schema: decision
seeds:
uk_property_analytics:
+schema: seeds
# dbt 1.8 requires this for state:modified to behave correctly with fresh sources
flags:
send_anonymous_usage_stats: false