Skip to content

Commit

Permalink
Enable multi project references and settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek committed Dec 16, 2024
1 parent 2d09443 commit 92d345f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions opendbt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
import sys
from pathlib import Path

######################
from opendbt.dbt import patch_dbt

patch_dbt()
from opendbt.utils import Utils
######################

from dbt.cli.main import dbtRunner as DbtCliRunner
from dbt.cli.main import dbtRunnerResult
from dbt.config import PartialProject
Expand All @@ -18,6 +11,14 @@
from dbt.exceptions import DbtRuntimeError
from dbt.task.base import get_nearest_project_dir

######################
from opendbt.dbt import patch_dbt
# patch_dbt()
from opendbt.utils import Utils


######################


class OpenDbtLogger:
_log = None
Expand Down Expand Up @@ -106,6 +107,7 @@ def run(args: list, callbacks: list = None) -> dbtRunnerResult:
:return: The result of the dbt run.
"""
callbacks = callbacks if callbacks else []
patch_dbt()
# https://docs.getdbt.com/reference/programmatic-invocations
dbtcr = DbtCliRunner(callbacks=callbacks)
result: dbtRunnerResult = dbtcr.invoke(args)
Expand Down
2 changes: 1 addition & 1 deletion opendbt/dbt/v17/config/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def load_dependencies(self, base_only=False) -> Mapping[str, "RuntimeConfig"]:

if self.dependencies is None:
# this sets self.dependencies variable!
self.dependencies = super().load_dependencies()
self.dependencies = super().load_dependencies(base_only=base_only)

# additionally load `projects` defined in `dependencies.yml`
for project_name, project in self.load_dependence_projects():
Expand Down
2 changes: 1 addition & 1 deletion opendbt/dbt/v18/config/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def load_dependencies(self, base_only=False) -> Mapping[str, "RuntimeConfig"]:

if self.dependencies is None:
# this sets self.dependencies variable!
self.dependencies = super().load_dependencies()
self.dependencies = super().load_dependencies(base_only=base_only)

# additionally load `projects` defined in `dependencies.yml`
for project_name, project in self.load_dependence_projects():
Expand Down

0 comments on commit 92d345f

Please sign in to comment.