From 6e92fda3705af515293c8c4a9381dcfdfb838081 Mon Sep 17 00:00:00 2001 From: Illia Yurtsiv Date: Mon, 17 Jun 2024 19:58:58 +0300 Subject: [PATCH] Fix: set ENV VARS as invocation context for dbt >= 1.8 --- src/dbt_osmosis/vendored/dbt_core_interface/project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbt_osmosis/vendored/dbt_core_interface/project.py b/src/dbt_osmosis/vendored/dbt_core_interface/project.py index 11af478..4586b11 100644 --- a/src/dbt_osmosis/vendored/dbt_core_interface/project.py +++ b/src/dbt_osmosis/vendored/dbt_core_interface/project.py @@ -87,7 +87,8 @@ try: # dbt >= 1.8 - from dbt_common.clients.system import make_directory + from dbt_common.clients.system import make_directory, get_env + from dbt_common.context import set_invocation_context except ImportError: # dbt < 1.8 from dbt.clients.system import make_directory @@ -386,6 +387,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