You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is a var('foo') call in a generate_schema_name macro, if foo does not exist, dbt returns None for it.
Steps To Reproduce
Add this macro:
{% macro generate_schema_name(custom_schema_name, node) -%}
{% do log(' *** The var is: ' ~ var('myvar'), info=true) %}
{% do return(target.schema) %}
{%- endmacro %}
Do not declare myvar
Run dbt
get a bunch of log messages that The var is: None.
Expected behavior
dbt should fail with an error about the var not being set.
System information
Any database, any python, any OS.
The output of dbt --version:
0.17.0rc1
Additional context
This is caused by dbt using the parse context for the generate_*_name macros. Really, we want a special context that is mostly the parse context except with runtime behavior for var.
This fix should be fairly straightforward as the context is only used for these macros, we can just change the macros we call.
The text was updated successfully, but these errors were encountered:
Describe the bug
When there is a
var('foo')
call in agenerate_schema_name
macro, iffoo
does not exist, dbt returns None for it.Steps To Reproduce
myvar
The var is: None
.Expected behavior
dbt should fail with an error about the var not being set.
System information
Any database, any python, any OS.
The output of
dbt --version
:Additional context
This is caused by dbt using the parse context for the
generate_*_name
macros. Really, we want a special context that is mostly the parse context except with runtime behavior forvar
.This fix should be fairly straightforward as the context is only used for these macros, we can just change the macros we call.
The text was updated successfully, but these errors were encountered: