Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The env_var Function Cannot Be Ued in the create_schema Macro #10599

Closed
2 tasks done
peterallenwebb opened this issue Aug 23, 2024 · 0 comments · Fixed by #10609 · May be fixed by #10601
Closed
2 tasks done

[Bug] The env_var Function Cannot Be Ued in the create_schema Macro #10599

peterallenwebb opened this issue Aug 23, 2024 · 0 comments · Fixed by #10609 · May be fixed by #10601
Labels
bug Something isn't working

Comments

@peterallenwebb
Copy link
Contributor

peterallenwebb commented Aug 23, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

The env_var() function does not work in overrides of the create_schema macro is overridden. For example, after defining and using the macro like this...

{% macro create_schema(relation) %}
  {%- call statement('create_schema' -%}
    create schema if not exists {{ relation.without_identifier() }} with {{ env_var('DBT_MANAGED_ACCESS') }}
  {% endcall %}
{% endmacro %}

...dbt reports

RuntimeError
'MacroManifest' object has no attribute 'env_vars'

This issue was reported to me by @T-Dunlap , was seeing it in dbt Cloud on "versionless".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants