diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68d08dd..65679ae 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: python-version: [ "3.9", "3.10", "3.11", "3.12" ] - dbt-version: [ "1.7", "1.8", "1.9" ] + dbt-version: [ "1.6", "1.7", "1.8", "1.9" ] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/opendbt/dbt/__init__.py b/opendbt/dbt/__init__.py index 76e3b4d..247963e 100644 --- a/opendbt/dbt/__init__.py +++ b/opendbt/dbt/__init__.py @@ -7,7 +7,14 @@ def patch_dbt(): # Monkey Patching! Override dbt lib code with new one # ================================================================================================================ dbt_version = Version(dbt.version.get_installed_version().to_version_string(skip_matcher=True)) - if Version("1.7.0") <= dbt_version < Version("1.8.0"): + if Version("1.6.0") <= dbt_version < Version("1.7.0"): + from opendbt.dbt.v17.task.docs.generate import OpenDbtGenerateTask + dbt.task.generate.GenerateTask = OpenDbtGenerateTask + from opendbt.dbt.v17.adapters.factory import OpenDbtAdapterContainer + dbt.adapters.factory.FACTORY = OpenDbtAdapterContainer() + from opendbt.dbt.v17.task.run import ModelRunner + dbt.task.run.ModelRunner = ModelRunner + elif Version("1.7.0") <= dbt_version < Version("1.8.0"): from opendbt.dbt.v17.task.docs.generate import OpenDbtGenerateTask dbt.task.generate.GenerateTask = OpenDbtGenerateTask from opendbt.dbt.v17.adapters.factory import OpenDbtAdapterContainer