Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/z3z1ma/dbt-osmosis into fea…
Browse files Browse the repository at this point in the history
…ture/test-DbtYamlManager
  • Loading branch information
kokorin committed Jun 14, 2024
2 parents 061ad04 + 3a0d14e commit 78c8345
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changes/0.13.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.13.1 - 2024-06-14
### Fixed
* Missing second argument for BaseAdapter in dbt-core 1.8+
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).


## 0.13.1 - 2024-06-14
### Fixed
* Missing second argument for BaseAdapter in dbt-core 1.8+

## 0.13.0 - 2024-06-12
### Added
* Test with multiple version of dbt core
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-osmosis"
version = "0.13.0"
version = "0.13.1"
description = "A dbt server and suite of optional developer tools to make developing with dbt delightful."
authors = ["z3z1ma <[email protected]>"]
license = "Apache-2.0"
Expand Down
13 changes: 5 additions & 8 deletions src/dbt_osmosis/vendored/dbt_core_interface/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

# region dbt-core-interface imports & monkey patches


if 1: # this stops ruff from complaining about the import order
import dbt.adapters.factory

Expand Down Expand Up @@ -412,7 +411,7 @@ def from_config(cls, config: DbtConfiguration) -> "DbtProject":
threads=config.threads,
)

def get_adapter_cls(self) -> "BaseAdapter":
def get_adapter_cls(self) -> Type["BaseAdapter"]:
"""Get the adapter class associated with the dbt profile."""
return get_adapter_class_by_name(self.config.credentials.type)

Expand All @@ -429,13 +428,11 @@ def initialize_adapter(self) -> None:
# The adapter.setter verifies connection, resets TTL, and updates adapter ref on config
# this is thread safe by virtue of the adapter_mutex on the adapter.setter
try:
from multiprocessing.context import SpawnContext

mp_context = SpawnContext()
self.adapter = self.get_adapter_cls()(self.config, mp_context)
except Exception as e:
LOGGER.debug(f"Failed to initialize adapter with SpawnContext, trying without it: {e}")
self.adapter = self.get_adapter_cls()(self.config)
except TypeError:
from dbt.mp_context import get_mp_context

self.adapter = self.get_adapter_cls()(self.config, get_mp_context())

@property
def adapter(self) -> "BaseAdapter":
Expand Down

0 comments on commit 78c8345

Please sign in to comment.