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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/dbt_osmosis/vendored/dbt_core_interface/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@

try:
# dbt >= 1.8
from dbt_common.clients.system import make_directory
from dbt_common.clients.system import get_env, make_directory
from dbt_common.context import set_invocation_context
except ImportError:
# dbt < 1.8
from dbt.clients.system import make_directory

from dbt.config.runtime import RuntimeConfig
from dbt.contracts.graph.nodes import ColumnInfo, ManifestNode
from dbt.flags import set_from_args
Expand Down Expand Up @@ -386,6 +388,8 @@ def __init__(
project_dir=project_dir or DEFAULT_PROJECT_DIR,
profile=profile,
)
if hasattr(sys.modules[__name__], "set_invocation_context"):
set_invocation_context(get_env())
if vars is None:
vars = "{}"
self.base_config.vars = vars
Expand Down