Skip to content

Commit

Permalink
feat(dbt): remove support for dbt-core==1.3.*
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Dec 8, 2023
1 parent fca0e95 commit 59a7f1a
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 50 deletions.
14 changes: 3 additions & 11 deletions python_modules/libraries/dagster-dbt/dagster_dbt/asset_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,10 @@ def _load_manifest_for_project(

def _can_stream_events(dbt_resource: Union[DbtCliClient, DbtCliResource]) -> bool:
"""Check if the installed dbt version supports streaming events."""
import dbt.version
from packaging import version

if version.parse(dbt.version.__version__) >= version.parse("1.4.0"):
# The json log format is required for streaming events. DbtCliResource always uses this format, but
# DbtCliClient has an option to disable it.
if isinstance(dbt_resource, DbtCliResource):
return True
else:
return dbt_resource._json_log_format # noqa: SLF001
if isinstance(dbt_resource, DbtCliResource):
return True
else:
return False
return dbt_resource._json_log_format # noqa: SLF001


def _batch_event_iterator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
if TYPE_CHECKING:
from dagster import Definitions

pytest.importorskip("dbt.version", minversion="1.4")

test_dagster_metadata_dbt_project_path = (
Path(__file__).joinpath("..", "..", "dbt_projects", "test_dagster_metadata").resolve()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os
import subprocess

import dbt.version
import pytest
from dagster._utils import file_relative_path, pushd
from dagster_dbt import DbtCliClientResource, DbtCliResource, dbt_cli_resource
from packaging import version

# ======= CONFIG ========
DBT_EXECUTABLE = "dbt"
Expand Down Expand Up @@ -54,13 +52,7 @@ def dbt_python_config_dir():
params=[
pytest.param("legacy", marks=pytest.mark.legacy),
pytest.param("DbtCliClientResource", marks=pytest.mark.legacy),
pytest.param(
"DbtCliResource",
marks=pytest.mark.skipif(
version.parse(dbt.version.__version__) < version.parse("1.4.0"),
reason="DbtCliResource only supports dbt 1.4+",
),
),
pytest.param("DbtCliResource"),
],
)
def dbt_cli_resource_factory(request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@

from ..conftest import TEST_PROJECT_DIR

pytest.importorskip("dbt.version", minversion="1.4")


manifest_path = Path(TEST_PROJECT_DIR).joinpath("manifest.json")
manifest = json.loads(manifest_path.read_bytes())

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from packaging import version
from pytest_mock import MockerFixture

pytest.importorskip("dbt.version", minversion="1.4")

is_dbt_1_4 = version.parse("1.4.0") <= version.parse(dbt_version) < version.parse("1.5.0")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
from dagster_dbt.dagster_dbt_translator import DagsterDbtTranslator
from dagster_dbt.dbt_manifest import DbtManifestParam

pytest.importorskip("dbt.version", minversion="1.4")


manifest_path = Path(__file__).joinpath("..", "sample_manifest.json").resolve()
manifest = json.loads(manifest_path.read_bytes())

Expand Down
2 changes: 1 addition & 1 deletion python_modules/libraries/dagster-dbt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_version() -> str:
install_requires=[
f"dagster{pin}",
# Follow the version support constraints for dbt Core: https://docs.getdbt.com/docs/dbt-versions/core
"dbt-core<1.8",
"dbt-core>=1.4,<1.8",
"Jinja2",
"networkx",
"orjson",
Expand Down
4 changes: 0 additions & 4 deletions python_modules/libraries/dagster-dbt/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ deps =
-e ../../dagster-pipes
-e ../dagster-duckdb
-e ../dagster-duckdb-pandas
dbt_13X: dbt-core==1.3.*
dbt_13X: dbt-duckdb==1.3.*
dbt_14X: dbt-core==1.4.*
dbt_14X: dbt-duckdb==1.4.*
dbt_15X: dbt-core==1.5.*
Expand All @@ -26,12 +24,10 @@ allowlist_externals =
/bin/bash
commands =
!windows: /bin/bash -c '! pip list --exclude-editable | grep -e dagster'
dbt_13X_legacy: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "legacy" -vv {posargs}
dbt_14X_legacy: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "legacy" -vv {posargs}
dbt_15X_legacy: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "legacy" -vv {posargs}
dbt_16X_legacy: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "legacy" -vv {posargs}
dbt_17X_legacy: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "legacy" -vv {posargs}
dbt_13X: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "not legacy" -vv {posargs}
dbt_14X: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "not legacy" -vv {posargs}
dbt_15X: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "not legacy" -vv {posargs}
dbt_16X: pytest --reruns 2 --durations 10 -c ../../../pyproject.toml -m "not legacy" -vv {posargs}
Expand Down

0 comments on commit 59a7f1a

Please sign in to comment.