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>
21 lines
719 B
Python
21 lines
719 B
Python
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'"
|