File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ def _extract_macro_func_variable_references(macro_func: exp.Expression) -> t.Set
164
164
# they will be handled in a separate call of _extract_macro_func_variable_references.
165
165
def _prune_nested_macro_func (expression : exp .Expression ) -> bool :
166
166
return (
167
- type (n ) is d .MacroFunc
168
- and n is not macro_func
169
- and n .this .name .lower () not in (c .VAR , c .BLUEPRINT_VAR )
167
+ type (expression ) is d .MacroFunc
168
+ and expression is not macro_func
169
+ and expression .this .name .lower () not in (c .VAR , c .BLUEPRINT_VAR )
170
170
)
171
171
172
172
for n in macro_func .walk (prune = _prune_nested_macro_func ):
@@ -208,6 +208,9 @@ def _add_variables_to_python_env(
208
208
used_variable_referenced_in_metadata_expression .get (var_name , True ) and is_metadata
209
209
)
210
210
211
+ # Variables are treated as metadata when:
212
+ # - They are only referenced in metadata-only contexts, such as `audits (...)`, virtual statements, etc
213
+ # - They are only referenced in metadata-only macros, either as their arguments of within their definitions
211
214
metadata_used_variables = set ()
212
215
for used_var , macro_names in (macro_funcs_by_used_var or {}).items ():
213
216
if used_variable_referenced_in_metadata_expression .get (used_var ) or all (
You can’t perform that action at this time.
0 commit comments