Skip to content

Commit 86b972c

Browse files
committed
Add DEMOTING runtime stage
1 parent d7d96b0 commit 86b972c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/concepts/macros/macro_variables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ SQLMesh provides additional predefined variables used to modify model behavior b
132132
* 'loading' - The project is being loaded into SQLMesh's runtime context.
133133
* 'creating' - The model tables are being created.
134134
* 'evaluating' - The model query logic is being evaluated.
135-
* 'promoting' - The model is being promoted in the target environment (virtual layer update).
135+
* 'promoting' - The model is being promoted in the target environment (view created during virtual layer update).
136+
* 'demoting' - The model is being demoted in the target environment (view dropped during virtual layer update).
136137
* 'auditing' - The audit is being run.
137138
* 'testing' - The model query logic is being evaluated in the context of a unit test.
138139
* @gateway - A string value containing the name of the current [gateway](../../guides/connections.md).

sqlmesh/core/macros.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class RuntimeStage(Enum):
6767
CREATING = "creating"
6868
EVALUATING = "evaluating"
6969
PROMOTING = "promoting"
70+
DEMOTING = "demoting"
7071
AUDITING = "auditing"
7172
TESTING = "testing"
7273
BEFORE_ALL = "before_all"

sqlmesh/core/snapshot/evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ def _demote_snapshot(
10371037
engine_adapter=adapter,
10381038
snapshots=snapshots,
10391039
deployability_index=deployability_index,
1040-
runtime_stage=RuntimeStage.PROMOTING,
1040+
runtime_stage=RuntimeStage.DEMOTING,
10411041
)
10421042
),
10431043
):

0 commit comments

Comments
 (0)