Skip to content

Commit 960bacb

Browse files
authored
fix: add missing sort root dict (#4986)
1 parent a274ac7 commit 960bacb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sqlmesh/core/model/definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ def create_python_model(
23612361

23622362
used_variables = {k: v for k, v in (variables or {}).items() if k in referenced_variables}
23632363
if used_variables:
2364-
python_env[c.SQLMESH_VARS] = Executable.value(used_variables)
2364+
python_env[c.SQLMESH_VARS] = Executable.value(used_variables, sort_root_dict=True)
23652365

23662366
return _create_model(
23672367
PythonModel,

tests/core/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6715,7 +6715,7 @@ def model_with_named_variables(
67156715
)
67166716

67176717
assert python_model.python_env[c.SQLMESH_VARS] == Executable.value(
6718-
{"test_var_a": "test_value", "start": "2024-01-01"}
6718+
{"test_var_a": "test_value", "start": "2024-01-01"}, sort_root_dict=True
67196719
)
67206720

67216721
context = ExecutionContext(mocker.Mock(), {}, None, None)

0 commit comments

Comments
 (0)