Skip to content

Commit 837c8f4

Browse files
committed
Only warn if python_env has SQLMESH_VARS or SQLMESH_BLUEPRINT_VARS
1 parent dc37534 commit 837c8f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sqlmesh/migrations/v0087_warn_about_variable_python_env_diffs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
from sqlmesh.core.console import get_console
3232

33+
SQLMESH_VARS = "__sqlmesh__vars__"
3334
SQLMESH_BLUEPRINT_VARS = "__sqlmesh__blueprint__vars__"
3435
METADATA_HASH_EXPRESSIONS = {"on_virtual_update", "audits", "signals", "audit_definitions"}
3536

@@ -62,9 +63,8 @@ def migrate(state_sync, **kwargs): # type: ignore
6263

6364
python_env = node.get("python_env") or {}
6465

65-
if (
66-
SQLMESH_BLUEPRINT_VARS in python_env
67-
or any(v.get("is_metadata") for v in python_env.values())
66+
if (SQLMESH_VARS in python_env or SQLMESH_BLUEPRINT_VARS in python_env) and (
67+
any(v.get("is_metadata") for v in python_env.values())
6868
or any(node.get(k) for k in METADATA_HASH_EXPRESSIONS)
6969
):
7070
get_console().log_warning(warning)

0 commit comments

Comments
 (0)