From bb5efcdde7cbaf345516c3268633ac9219b9f7af Mon Sep 17 00:00:00 2001 From: McKnight-42 Date: Thu, 1 Aug 2024 15:54:18 -0500 Subject: [PATCH] migrate away from spark specific version of test to universal one test --- .../test_incremental_on_schema_change.py | 56 +------------------ 1 file changed, 3 insertions(+), 53 deletions(-) diff --git a/tests/functional/adapter/incremental/test_incremental_on_schema_change.py b/tests/functional/adapter/incremental/test_incremental_on_schema_change.py index a38fd3910..216209867 100644 --- a/tests/functional/adapter/incremental/test_incremental_on_schema_change.py +++ b/tests/functional/adapter/incremental/test_incremental_on_schema_change.py @@ -4,6 +4,7 @@ from dbt.tests.adapter.incremental.test_incremental_on_schema_change import ( BaseIncrementalOnSchemaChangeSetup, + BaseIncrementalCaseSenstivityOnSchemaChange, ) @@ -82,56 +83,5 @@ def test_run_incremental_sync_all_columns(self, project): self.run_incremental_sync_remove_only(project) -_MODELS__SRC_ARTISTS = """ -{{ - config( - materialized='table', - ) -}} -{% if var("version", 0) == 0 %} - - select {{ dbt.current_timestamp() }} as inserted_at, 'john' as name - -{% else %} - - -- add a non-zero version to the end of the command to get a different version: - -- --vars "{'version': 1}" - select {{ dbt.current_timestamp() }} as inserted_at, 'john' as name, 'engineer' as `Job` - -{% endif %} -""" - -_MODELS__DIM_ARTISTS = """ -{{ - config( - materialized='incremental', - on_schema_change='append_new_columns', - ) -}} - -select * from {{ ref("src_artists") }} -""" - - -@pytest.mark.skip_profile("apache_spark", "spark_session") -class TestIncrementalCaseSenstivityOnSchemaChange: - @pytest.fixture(scope="class") - def models(self): - return { - "src_artists.sql": _MODELS__SRC_ARTISTS, - "dim_artists.sql": _MODELS__DIM_ARTISTS, - } - - def test_run_incremental_check_quoting_on_new_columns(self, project): - select = "src_artists dim_artists" - run_dbt(["run", "--models", select, "--full-refresh"]) - res, logs = run_dbt_and_capture( - ["show", "--inline", "select * from {{ ref('dim_artists') }}"] - ) - assert "Job" not in logs - - run_dbt(["run", "--vars", "{'version': 1}"]) - res, logs = run_dbt_and_capture( - ["show", "--inline", "select * from {{ ref('dim_artists') }}"] - ) - assert "Job" in logs +class TestIncrementalCaseSenstivityOnSchemaChange(BaseIncrementalCaseSenstivityOnSchemaChange): + pass