From ba28487e1bd12acb98019585aa07bf6d627764a3 Mon Sep 17 00:00:00 2001 From: Josh Wills Date: Mon, 8 May 2023 16:32:51 -0700 Subject: [PATCH] Prepping the dbt-duckdb tests to pass under the next release of DuckDB --- tests/conftest.py | 5 +++++ tests/functional/adapter/test_rematerialize.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 46cab077..3294b4f3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,7 @@ import subprocess import time +import duckdb import pytest @@ -43,6 +44,10 @@ def bv_server_process(profile_type): def dbt_profile_target(profile_type, bv_server_process, tmp_path_factory): profile = {"type": "duckdb", "threads": 4} + if duckdb.__version__ > "0.7.1": + # for backwards compatibility + profile["settings"] = {"integer_division": True} + if profile_type == "buenavista": profile["database"] = "memory" profile["remote"] = { diff --git a/tests/functional/adapter/test_rematerialize.py b/tests/functional/adapter/test_rematerialize.py index 82e2377e..4f821df2 100644 --- a/tests/functional/adapter/test_rematerialize.py +++ b/tests/functional/adapter/test_rematerialize.py @@ -21,7 +21,7 @@ """ downstream_of_partition_model = """ -select a * 3 from {{ ref('upstream_partition_by_model') }} +select a from {{ ref('upstream_partition_by_model') }} """