fix(pipeline): use sqlmesh plan --auto-apply instead of sqlmesh run
`sqlmesh run` only re-evaluates intervals for already-planned models — it does not detect new, modified, or deleted models. Switching to `plan prod --auto-apply` ensures schema changes (like the new location_profiles model) are picked up automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -737,9 +737,9 @@ async def handle_run_extraction(payload: dict) -> None:
|
||||
|
||||
@task("run_transform")
|
||||
async def handle_run_transform(payload: dict) -> None:
|
||||
"""Run SQLMesh transform (prod run) in the background.
|
||||
"""Run SQLMesh transform (prod plan + apply) in the background.
|
||||
|
||||
Shells out to `uv run sqlmesh -p transform/sqlmesh_padelnomics run prod`.
|
||||
Shells out to `uv run sqlmesh -p transform/sqlmesh_padelnomics plan prod --auto-apply`.
|
||||
2-hour absolute timeout — same as extraction.
|
||||
"""
|
||||
import subprocess
|
||||
@@ -748,7 +748,7 @@ async def handle_run_transform(payload: dict) -> None:
|
||||
repo_root = Path(__file__).resolve().parents[4]
|
||||
result = await asyncio.to_thread(
|
||||
subprocess.run,
|
||||
["uv", "run", "sqlmesh", "-p", "transform/sqlmesh_padelnomics", "run", "prod"],
|
||||
["uv", "run", "sqlmesh", "-p", "transform/sqlmesh_padelnomics", "plan", "prod", "--auto-apply"],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=7200,
|
||||
@@ -803,7 +803,7 @@ async def handle_run_pipeline(payload: dict) -> None:
|
||||
),
|
||||
(
|
||||
"transform",
|
||||
["uv", "run", "sqlmesh", "-p", "transform/sqlmesh_padelnomics", "run", "prod"],
|
||||
["uv", "run", "sqlmesh", "-p", "transform/sqlmesh_padelnomics", "plan", "prod", "--auto-apply"],
|
||||
7200,
|
||||
),
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user