Skip to content

Commit

Permalink
Register adapter for dbt version 1.8.0 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Jun 2, 2024
1 parent ae0dfa4 commit 55ab835
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pytest_dbt_core/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
import dbt.semver as semver


if semver.VersionSpecifier("1", "7", "16") < DBT_INSTALLED_VERSION:
from dbt.mp_context import get_mp_context


dbt.tracking.active_user = User(os.getcwd())


Expand Down Expand Up @@ -117,7 +121,10 @@ def adapter(config: RuntimeConfig) -> AdapterContainer:
AdapterContainer
The adapter.
"""
register_adapter(config)
if semver.VersionSpecifier("1", "7", "16") < DBT_INSTALLED_VERSION:
register_adapter(config, get_mp_context())
else:
register_adapter(config)
adapter = get_adapter(config)
adapter.acquire_connection()
return adapter
Expand Down

0 comments on commit 55ab835

Please sign in to comment.