From 5b43a16f9c4c79e3ad03d6be07c3682b3a4d41fc Mon Sep 17 00:00:00 2001 From: Pradeep Srikakolapu Date: Sat, 18 May 2024 23:47:15 -0700 Subject: [PATCH] pinning v1.8.0 dbt adapter and optimizing snapshot issues --- dbt/adapters/fabric/__version__.py | 2 +- .../fabric/macros/materializations/snapshots/snapshot.sql | 5 ++++- setup.py | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dbt/adapters/fabric/__version__.py b/dbt/adapters/fabric/__version__.py index eaf9d19..f2493fc 100644 --- a/dbt/adapters/fabric/__version__.py +++ b/dbt/adapters/fabric/__version__.py @@ -1 +1 @@ -version = "1.8.3" +version = "1.8.4" diff --git a/dbt/include/fabric/macros/materializations/snapshots/snapshot.sql b/dbt/include/fabric/macros/materializations/snapshots/snapshot.sql index 02131f4..83e3f9b 100644 --- a/dbt/include/fabric/macros/materializations/snapshots/snapshot.sql +++ b/dbt/include/fabric/macros/materializations/snapshots/snapshot.sql @@ -54,7 +54,10 @@ | rejectattr('name', 'equalto', 'dbt_unique_key') | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY') | list %} - {% do create_columns(target_relation, missing_columns) %} + {% if missing_columns|length > 0 %} + {{log("Missing columns length is: "~ missing_columns|length)}} + {% do create_columns(target_relation, missing_columns) %} + {% endif %} {% set source_columns = adapter.get_columns_in_relation(staging_table) | rejectattr('name', 'equalto', 'dbt_change_type') | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE') diff --git a/setup.py b/setup.py index e8cc934..3deed70 100644 --- a/setup.py +++ b/setup.py @@ -68,9 +68,9 @@ def run(self): install_requires=[ "pyodbc>=4.0.35,<5.2.0", "azure-identity>=1.12.0", - "dbt-common>=0.1.0a1,<2.0", - "dbt-core>=1.8.0a1", - "dbt-adapters>=0.1.0a1,<2.0", + "dbt-common>=1.0.4,<2.0", + "dbt-core>=1.8.0", + "dbt-adapters>=1.1.1,<2.0", ], cmdclass={ "verify": VerifyVersionCommand,