Skip to content

Commit

Permalink
Merge pull request #3 from edx/jazibhumayun/dbt-version-upgrade
Browse files Browse the repository at this point in the history
chore: dbt version 0.21 upgrade
  • Loading branch information
jazibhumayun authored Dec 10, 2021
2 parents 75d396c + 30dcdb3 commit 5ea3565
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
config-version: 2

name: 'snowflake_timetravel_table'
version: '0.0.1'
version: '0.0.2'
19 changes: 4 additions & 15 deletions integration_tests/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 6 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand All @@ -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]
Expand Down

0 comments on commit 5ea3565

Please sign in to comment.