From 30dcdb32707b67e6ee917b061d442bbcd382edfd Mon Sep 17 00:00:00 2001 From: Jazib Humayun Date: Wed, 8 Dec 2021 04:32:04 +0500 Subject: [PATCH] chore: dbt version 0.21 upgrade dbt version 0.21 upgrade and dropping support for dbt version 0.18 and 0.19 --- dbt_project.yml | 2 +- integration_tests/tests/test_integration.py | 19 ++++--------------- tox.ini | 13 ++++++------- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 68f37a3..c2cd302 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,4 +1,4 @@ config-version: 2 name: 'snowflake_timetravel_table' -version: '0.0.1' +version: '0.0.2' diff --git a/integration_tests/tests/test_integration.py b/integration_tests/tests/test_integration.py index edb2abf..203cf98 100644 --- a/integration_tests/tests/test_integration.py +++ b/integration_tests/tests/test_integration.py @@ -75,21 +75,10 @@ def test_validate_time_travel(): run_results = json.load(run_results_file) no_change_model_results = None - if ( - "metadata" in run_results - and run_results["metadata"]["dbt_schema_version"] == "https://schemas.getdbt.com/dbt/run-results/v1.json" - ): - # dbt v0.19 uses this run-results schema version. - for model_results in run_results["results"]: - if model_results["unique_id"].endswith(".snowflake_timetravel_table_integration_tests_columns_no_change"): - no_change_model_results = model_results - break - else: - # dbt v0.18 and earlier uses this non-versioned run-results schema version. - for model_results in run_results["results"]: - if model_results["node"]["alias"] == "snowflake_timetravel_table_integration_tests_columns_no_change": - no_change_model_results = model_results - break + for model_results in run_results["results"]: + if model_results["unique_id"].endswith(".snowflake_timetravel_table_integration_tests_columns_no_change"): + no_change_model_results = model_results + break # Determine when exactly the _columns_no_change test started to execute which is close to the moment when time # travel history changes for this model. diff --git a/tox.ini b/tox.ini index 2d01607..100488c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] # use skipsdist=True to avoid needing a setup.py, since the thing we are testing is NOT a python package. skipsdist = True -envlist = py38-dbt{018,019}-int +envlist = py38-dbt{021}-int [pytest] testpaths = @@ -21,14 +21,13 @@ setenv = SNOWFLAKE_TEST_PASSWORD={env:SNOWFLAKE_TEST_PASSWORD:} deps = pytest - dbt018: dbt>=0.18,<0.19 - dbt019: dbt>=0.19,<0.20 + dbt021: dbt>=0.21,<1.0 commands = # --full-refresh will cause seed to drop existing seed tables first, which helps make tests deterministic. - dbt seed --project-dir integration_tests/seed_project --profiles-dir '../test_profile' --full-refresh - dbt run --project-dir integration_tests/seed_project --profiles-dir '../test_profile' - dbt deps --project-dir integration_tests/run_project --profiles-dir '../test_profile' - dbt run --project-dir integration_tests/run_project --profiles-dir '../test_profile' + dbt seed --project-dir integration_tests/seed_project --profiles-dir integration_tests/test_profile --full-refresh + dbt run --project-dir integration_tests/seed_project --profiles-dir integration_tests/test_profile + dbt deps --project-dir integration_tests/run_project --profiles-dir integration_tests/test_profile + dbt run --project-dir integration_tests/run_project --profiles-dir integration_tests/test_profile pytest {posargs} [testenv:black]