refactor: rename materia → beanflows throughout codebase
- Rename src/materia/ → src/beanflows/ (Python package)
- Rename transform/sqlmesh_materia/ → transform/sqlmesh_beanflows/
- Rename infra/supervisor/materia-supervisor.service → beanflows-supervisor.service
- Rename infra/backup/materia-backup.{service,timer} → beanflows-backup.{service,timer}
- Update all path strings: /opt/materia → /opt/beanflows, /data/materia → /data/beanflows
- Update pyproject.toml: project name, CLI entrypoint, workspace source key
- Update all internal imports from materia.* → beanflows.*
- Update infra scripts: REPO_DIR, service names, systemctl references
- Fix docker-compose.prod.yml: /data/materia → /data/beanflows (bind mount path)
Intentionally left unchanged: Pulumi stack name (materia-infrastructure) and
Hetzner resource names ("materia-key", "managed_by: materia") — these reference
live cloud infrastructure and require separate cloud-side renames.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
63
transform/sqlmesh_beanflows/macros/__init__.py
Normal file
63
transform/sqlmesh_beanflows/macros/__init__.py
Normal file
@@ -0,0 +1,63 @@
|
||||
import os
|
||||
|
||||
from sqlmesh import macro
|
||||
|
||||
|
||||
@macro()
|
||||
def psd_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all PSD CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/psd/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def cot_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all COT CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/cot/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def cot_combined_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all COT combined (futures+options) CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/cot_combined/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def prices_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all coffee price CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/prices/coffee_kc/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def ice_stocks_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all ICE warehouse stock CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/ice_stocks/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def ice_aging_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all ICE aging report CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/ice_aging/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def ice_stocks_by_port_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all ICE historical by-port CSV gzip files under LANDING_DIR."""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/ice_stocks_by_port/**/*.csv.gzip'"
|
||||
|
||||
|
||||
@macro()
|
||||
def weather_glob(evaluator) -> str:
|
||||
"""Return a quoted glob path for all OWM weather JSON gzip files under LANDING_DIR.
|
||||
|
||||
Pattern: weather/{location_id}/{year}/{date}.json.gz
|
||||
The double-star catches all location_id subdirectories.
|
||||
"""
|
||||
landing_dir = evaluator.var("LANDING_DIR") or os.environ.get("LANDING_DIR", "data/landing")
|
||||
return f"'{landing_dir}/weather/**/*.json.gz'"
|
||||
Reference in New Issue
Block a user