feat: copier update v0.9.0 → v0.10.0
Pulls in template changes: export_serving.py for atomic DuckDB swap, supervisor export step, SQLMesh glob macro, server provisioning script, imprint template, and formatting improvements. Template scaffold SQL models excluded (padelnomics has real models). Web app routes/analytics unchanged (padelnomics-specific customizations). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,21 +21,21 @@ uv run sqlmesh -p transform/sqlmesh_padelnomics format
|
||||
## 4-layer architecture
|
||||
|
||||
```
|
||||
landing/ <- raw files (extraction output)
|
||||
+-- padelnomics/
|
||||
+-- {year}/{etag}.csv.gz
|
||||
landing/ ← raw files (extraction output)
|
||||
└── padelnomics/
|
||||
└── {year}/{etag}.csv.gz
|
||||
|
||||
raw/ <- reads files verbatim
|
||||
+-- raw.padelnomics
|
||||
raw/ ← reads files verbatim
|
||||
└── raw.padelnomics
|
||||
|
||||
staging/ <- type casting, deduplication
|
||||
+-- staging.stg_padelnomics
|
||||
staging/ ← type casting, deduplication
|
||||
└── staging.stg_padelnomics
|
||||
|
||||
foundation/ <- business logic, dimensions, facts
|
||||
+-- foundation.dim_category
|
||||
foundation/ ← business logic, dimensions, facts
|
||||
└── foundation.dim_category
|
||||
|
||||
serving/ <- pre-aggregated for web app
|
||||
+-- serving.padelnomics_metrics
|
||||
serving/ ← pre-aggregated for web app
|
||||
└── serving.padelnomics_metrics
|
||||
```
|
||||
|
||||
### raw/ — verbatim source reads
|
||||
|
||||
20
transform/sqlmesh_padelnomics/macros/__init__.py
Normal file
20
transform/sqlmesh_padelnomics/macros/__init__.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
|
||||
from sqlmesh import macro
|
||||
|
||||
|
||||
@macro()
|
||||
def padelnomics_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all padelnomics CSV gz files under LANDING_DIR.
|
||||
|
||||
Used in raw models: SELECT * FROM read_csv(@padelnomics_glob(), ...)
|
||||
|
||||
The LANDING_DIR variable is read from the SQLMesh config variables block first,
|
||||
then falls back to the LANDING_DIR environment variable, then to 'data/landing'.
|
||||
"""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/padelnomics/**/*.csv.gz'"
|
||||
|
||||
|
||||
# Add one macro per landing zone subdirectory you create.
|
||||
# Pattern: def {source}_glob(evaluator) → f"'{landing_dir}/{source}/**/*.csv.gz'"
|
||||
Reference in New Issue
Block a user