Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing failing tests from newer dbt versions #817

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading