Skip to content

Commit 13b2109

Browse files
committed
Improve warn heuristic
1 parent b08a8ce commit 13b2109

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sqlmesh/migrations/v0092_warn_about_dbt_data_type_diff.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
from sqlmesh.core.console import get_console
1616

17+
SQLMESH_DBT_PACKAGE = "sqlmesh.dbt"
18+
1719

1820
def migrate(state_sync, **kwargs): # type: ignore
1921
engine_adapter = state_sync.engine_adapter
@@ -38,6 +40,9 @@ def migrate(state_sync, **kwargs): # type: ignore
3840
parsed_snapshot = json.loads(snapshot)
3941
node = parsed_snapshot["node"]
4042

41-
if node.get("columns"):
43+
jinja_macros = node.get("jinja_macros") or {}
44+
create_builtins_module = jinja_macros.get("create_builtins_module") or ""
45+
46+
if create_builtins_module == SQLMESH_DBT_PACKAGE and node.get("columns"):
4247
get_console().log_warning(warning)
4348
return

0 commit comments

Comments
 (0)