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

Fix: set ENV VARS as invocation context for dbt >= 1.8 #165

Conversation

illia-yurtsiv-proxet
Copy link

Rationale:

dbt_core v1.8.0 introduces dependency on dbt_common package which wasn't the thing prior to 1.8.x.
In dbt_common, they introduce InvocationContext class.
It's used in cli's preflight decorator that sets the context before any actual CLI operation:

Then it's used in dbt_core's SecretContext which is necessary if you use something like:
CleanShot 2024-06-17 at 20 28 54@2x

Changes:

This PR tries to import set_invocation_context and get_env from dbt_common and then set ENV VARs before actual profile rendering in Jinja.

@illia-yurtsiv-proxet
Copy link
Author

@z3z1ma please, pay attention, that this PR is required to support DBT 1.8

@illia-yurtsiv-proxet illia-yurtsiv-proxet force-pushed the feature/set-env-vars-as-invocation-context-for-dbt-1.8 branch from 2f94651 to a9c47ed Compare June 17, 2024 21:32
@z3z1ma z3z1ma merged commit 68ca97b into z3z1ma:main Jun 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants