Skip to content

Commit 6906303

Browse files
committed
Add migration script that checks for potential diffs and warns about it
1 parent 34f61e9 commit 6906303

2 files changed

Lines changed: 496 additions & 4 deletions

File tree

sqlmesh/core/model/definition.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,11 +2407,12 @@ def _create_model(
24072407
if "on_virtual_update" in kwargs:
24082408
statements.extend(kwargs["on_virtual_update"])
24092409

2410-
# to allow variables like @gateway to be used in these properties
2411-
# since rendering shifted from load time to run time
2410+
# This is done to allow variables like @gateway to be used in these properties
2411+
# since rendering shifted from load time to run time.
2412+
# Note: we check for Tuple since that's what we expect from _resolve_properties
24122413
for property_name in PROPERTIES:
2413-
if property_values := kwargs.get(property_name):
2414-
statements.extend(property_values)
2414+
if isinstance(property_values := kwargs.get(property_name), exp.Tuple):
2415+
statements.extend(property_values.expressions)
24152416

24162417
jinja_macro_references, used_variables = extract_macro_references_and_variables(
24172418
*(gen(e) for e in statements)

0 commit comments

Comments
 (0)