Skip to content

Commit 4d30445

Browse files
committed
feedback
1 parent cd11ba5 commit 4d30445

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

sqlmesh/utils/jinja.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ def _extract(node: nodes.Node, parent: t.Optional[nodes.Node] = None) -> None:
200200
return extracted
201201

202202

203+
def is_variable_node(n: nodes.Node) -> bool:
204+
return (
205+
isinstance(n, nodes.Call)
206+
and isinstance(n.node, nodes.Name)
207+
and n.node.name in (c.VAR, c.BLUEPRINT_VAR)
208+
)
209+
210+
203211
def extract_macro_references_and_variables(
204212
*jinja_strs: str, dbt_target_name: t.Optional[str] = None
205213
) -> t.Tuple[t.Set[MacroReference], t.Set[str]]:
@@ -228,13 +236,6 @@ def extract_macro_references_and_variables(
228236
)
229237
)
230238

231-
def is_variable_node(n: nodes.Node) -> bool:
232-
return (
233-
isinstance(n, nodes.Call)
234-
and isinstance(n.node, nodes.Name)
235-
and n.node.name in (c.VAR, c.BLUEPRINT_VAR)
236-
)
237-
238239
for call_name, node in extract_call_names(jinja_str):
239240
if call_name[0] in (c.VAR, c.BLUEPRINT_VAR):
240241
if not is_variable_node(node):

0 commit comments

Comments
 (0)