Skip to content

Commit

Permalink
Fixing failing tests from newer dbt versions (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db authored Oct 3, 2024
1 parent c733aa5 commit 6bcd4ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ types-requests
types-mock
pre-commit

dbt-tests-adapter~=1.8.0
dbt-tests-adapter>=1.10.0, <2.0
2 changes: 1 addition & 1 deletion tests/functional/adapter/constraints/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6bcd4ea

Please sign in to comment.