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/dbt/include/fabric/macros/materializations/tests/helpers.sql b/dbt/include/fabric/macros/materializations/tests/helpers.sql index e902553..ad8c4d8 100644 --- a/dbt/include/fabric/macros/materializations/tests/helpers.sql +++ b/dbt/include/fabric/macros/materializations/tests/helpers.sql @@ -2,7 +2,7 @@ {% if main_sql.strip().lower().startswith('with') %} {% set testview %} - {{ generate_schema_name('tests_schema') }}.testview_{{ range(1300, 19000) | random }} + {{ config.get('schema') }}.testview_{{ range(1300, 19000) | random }} {% endset %} {% set sql = main_sql.replace("'", "''")%} diff --git a/dev_requirements.txt b/dev_requirements.txt index 46d6864..a42c6b9 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,8 +1,9 @@ # install latest changes in dbt-core # TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-core.git@fc431010ef0bd11ee6a502fc6c9e5e3e75c5d72d#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-adapters.git@4c289b150853b94beb67921f2a8dd203abe53cbe -git+https://github.com/dbt-labs/dbt-adapters.git@4c289b150853b94beb67921f2a8dd203abe53cbe#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-core.git@v1.8.0#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-adapters.git +git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-common.git pytest==8.0.1 twine==5.0.0 diff --git a/setup.py b/setup.py index e8cc934..b8e33c5 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, diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index ed7ed9f..6ff5265 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -44,7 +44,6 @@ description: hello constraints: - type: not_null - - type: primary_key - type: unique - type: check expression: (id > 0) @@ -92,7 +91,6 @@ description: hello constraints: - type: not_null - - type: primary_key - type: check expression: (id > 0) tests: diff --git a/tests/functional/adapter/test_dbt_clone.py b/tests/functional/adapter/test_dbt_clone.py index 29d5009..03108a5 100644 --- a/tests/functional/adapter/test_dbt_clone.py +++ b/tests/functional/adapter/test_dbt_clone.py @@ -84,17 +84,14 @@ def copy_state(self, project_root): def run_and_save_state(self, project_root, with_snapshot=False): results = run_dbt(["seed"]) assert len(results) == 1 - assert not any(r.node.deferred for r in results) results = run_dbt(["run"]) assert len(results) == 2 - assert not any(r.node.deferred for r in results) results = run_dbt(["test"]) assert len(results) == 2 if with_snapshot: results = run_dbt(["snapshot"]) assert len(results) == 1 - assert not any(r.node.deferred for r in results) # copy files self.copy_state(project_root) diff --git a/tests/functional/adapter/test_query_comment.py b/tests/functional/adapter/test_query_comment.py index 1488274..7e4781a 100644 --- a/tests/functional/adapter/test_query_comment.py +++ b/tests/functional/adapter/test_query_comment.py @@ -1,3 +1,5 @@ +import json + from dbt.tests.adapter.query_comment.test_query_comment import ( BaseEmptyQueryComments, BaseMacroArgsQueryComments, @@ -6,8 +8,6 @@ BaseNullQueryComments, BaseQueryComments, ) -from dbt.version import __version__ as dbt_version -import json # Tests # @@ -20,11 +20,10 @@ class TestMacroQueryComments(BaseMacroQueryComments): class TestMacroArgsQueryComments(BaseMacroArgsQueryComments): - def test_matches_comment(self, project) -> bool: + def test_matches_comment(self, project): logs = self.run_get_json() expected_dct = { "app": "dbt++", - "dbt_version": dbt_version, "macro_version": "0.1.0", "message": f"blah: {project.adapter.config.target_name}", }