Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
599 changes: 303 additions & 296 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ classifiers = [
[tool.poetry.dependencies]
python = "^3.7"
apache-airflow = ">=1.10.12, < 3.0.0"
dbt-core = ">=0.19, < 0.21"
dbt-core = ">=0.19, < 0.22"
# Flask is required by Airflow, but the dependency hasn't been updated to fix an issue
# with Flask-OpenID is breaking our build.
# See details: https://github.com/pallets-eco/flask-openid/pull/60
Flask-OpenID = ">=1.3.0"

apache-airflow-providers-amazon = { version = "^2.1.0", optional = true }
dbt-postgres = { version = ">=0.19, < 0.21", optional = true }
dbt-redshift = { version = ">=0.19, < 0.21", optional = true }
dbt-snowflake = { version = ">=0.19, < 0.21", optional = true }
dbt-bigquery = { version = ">=0.19, < 0.21", optional = true }
dbt-postgres = "0.21"
dbt-redshift = { version = ">=0.19, < 0.22", optional = true }
dbt-snowflake = { version = ">=0.19, < 0.22", optional = true }
dbt-bigquery = { version = ">=0.19, < 0.22", optional = true }

# Documentation extras
Sphinx = { version = "4.2.0", optional = true }
Expand All @@ -40,7 +40,6 @@ pytest = "^6.2.4"
pre-commit = "^2.12.1"
pytest-postgresql = "^3.1.1"
psycopg2-binary = "^2.8.6"
dbt-postgres = "^0.20"
isort = "^5.9.2"
moto = "^2.2.2"

Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pytest_postgresql.janitor import DatabaseJanitor

DBT_VERSION = parse(DBT_VERSION)
IS_DBT_VERSION_0_20 = DBT_VERSION.minor == 20 and DBT_VERSION.major == 0
IS_DBT_VERSION_LESS_THAN_0_20 = DBT_VERSION.minor < 20 and DBT_VERSION.major == 0

PROFILES = """
default:
Expand All @@ -29,7 +29,7 @@
version: 1.0.0
"""

if IS_DBT_VERSION_0_20:
if not IS_DBT_VERSION_LESS_THAN_0_20:
PROJECT += """
dispatch:
- macro_namespace: dbt_utils
Expand Down
5 changes: 3 additions & 2 deletions tests/test_dbt_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
from airflow_dbt_python.operators.dbt import DbtCompileOperator

DBT_VERSION = parse(DBT_VERSION)
IS_DBT_VERSION_0_20 = DBT_VERSION.minor == 20 and DBT_VERSION.major == 0
IS_DBT_VERSION_LESS_THAN_0_20 = DBT_VERSION.minor < 20 and DBT_VERSION.major == 0


def test_dbt_compile_mocked_all_args():
"""Test mocked dbt compile call with all arguments."""
op = DbtCompileOperator(
task_id="dbt_task",
project_dir="/path/to/project/",
Expand Down Expand Up @@ -111,7 +112,7 @@ def test_dbt_compile_non_existent_model(profiles_file, dbt_project_file, model_f
NOW() AS field2
"""

if IS_DBT_VERSION_0_20:
if not IS_DBT_VERSION_LESS_THAN_0_20:
cte = "cte"
else:
cte = "CTE"
Expand Down
7 changes: 4 additions & 3 deletions tests/test_dbt_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
from airflow_dbt_python.operators.dbt import DbtDebugOperator

DBT_VERSION = parse(DBT_VERSION)
IS_DBT_VERSION_0_20 = DBT_VERSION.minor == 20 and DBT_VERSION.major == 0
IS_DBT_VERSION_LESS_THAN_0_20 = DBT_VERSION.minor < 20 and DBT_VERSION.major == 0


def test_dbt_debug_mocked_all_args():
"""Test mocked dbt debug call with all arguments."""
op = DbtDebugOperator(
task_id="dbt_task",
project_dir="/path/to/project/",
Expand Down Expand Up @@ -70,7 +71,7 @@ def test_dbt_debug_config_dir(profiles_file, dbt_project_file):
)
output = op.execute({})

if IS_DBT_VERSION_0_20:
if not IS_DBT_VERSION_LESS_THAN_0_20:
assert output is True
else:
assert output is None
Expand All @@ -85,7 +86,7 @@ def test_dbt_debug(profiles_file, dbt_project_file):
)
output = op.execute({})

if IS_DBT_VERSION_0_20:
if not IS_DBT_VERSION_LESS_THAN_0_20:
assert output is True
else:
assert output is None
4 changes: 2 additions & 2 deletions tests/test_dbt_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def dbt_modules_dir(dbt_project_file):

PACKAGES = """
packages:
- package: fishtown-analytics/dbt_utils
version: 0.7.0
- package: dbt-labs/dbt_utils
version: 0.7.3
"""


Expand Down
1 change: 1 addition & 0 deletions tests/test_dbt_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


def test_dbt_parse_mocked_all_args():
"""Test mocked dbt parse call with all arguments."""
op = DbtParseOperator(
task_id="dbt_task",
project_dir="/path/to/project/",
Expand Down
1 change: 1 addition & 0 deletions tests/test_dbt_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


def test_dbt_run_mocked_all_args():
"""Test mocked dbt run call with all arguments."""
op = DbtRunOperator(
task_id="dbt_task",
project_dir="/path/to/project/",
Expand Down