From 990ad5ba0870d712d7ebf695e29d2743fc356d49 Mon Sep 17 00:00:00 2001 From: Ben Cassell Date: Thu, 3 Oct 2024 14:21:08 -0700 Subject: [PATCH 1/3] let's see if this fixes things --- dbt/adapters/databricks/connections.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbt/adapters/databricks/connections.py b/dbt/adapters/databricks/connections.py index cf6f600a..c4a297b4 100644 --- a/dbt/adapters/databricks/connections.py +++ b/dbt/adapters/databricks/connections.py @@ -75,6 +75,7 @@ from dbt_common.events.functions import fire_event from dbt_common.exceptions import DbtInternalError from dbt_common.exceptions import DbtRuntimeError +from dbt_common.exceptions import DbtDatabaseError from dbt_common.utils import cast_to_str from requests import Session @@ -508,7 +509,7 @@ def exception_handler(self, sql: str) -> Iterator[None]: except Error as exc: logger.debug(QueryError(log_sql, exc)) - raise DbtRuntimeError(str(exc)) from exc + raise DbtDatabaseError(str(exc)) from exc except Exception as exc: logger.debug(QueryError(log_sql, exc)) @@ -518,9 +519,9 @@ def exception_handler(self, sql: str) -> Iterator[None]: thrift_resp = exc.args[0] if hasattr(thrift_resp, "status"): msg = thrift_resp.status.errorMessage - raise DbtRuntimeError(msg) from exc + raise DbtDatabaseError(msg) from exc else: - raise DbtRuntimeError(str(exc)) from exc + raise DbtDatabaseError(str(exc)) from exc # override/overload def set_connection_name( From ebf1f3ed654548c2d9bf29a111724ca90b7cbd62 Mon Sep 17 00:00:00 2001 From: Ben Cassell Date: Thu, 3 Oct 2024 14:23:06 -0700 Subject: [PATCH 2/3] fix other issue --- tests/functional/adapter/constraints/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/adapter/constraints/fixtures.py b/tests/functional/adapter/constraints/fixtures.py index 1a9d1013..7a1c3ee3 100644 --- a/tests/functional/adapter/constraints/fixtures.py +++ b/tests/functional/adapter/constraints/fixtures.py @@ -81,7 +81,7 @@ - type: foreign_key name: fk_example__child_table_1 columns: ["parent_id"] - to: parent_table + to: ref('parent_table') to_columns: ["id"] columns: - name: id From 085c933052524fa215a639a683ec0932ca51166b Mon Sep 17 00:00:00 2001 From: Ben Cassell Date: Thu, 3 Oct 2024 14:46:41 -0700 Subject: [PATCH 3/3] need newer adapter tests version --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 46c95b6e..0c3ba458 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -15,4 +15,4 @@ types-requests types-mock pre-commit -dbt-tests-adapter~=1.8.0 +dbt-tests-adapter>=1.10.0, <2.0