diff --git a/CHANGELOG.md b/CHANGELOG.md index eda5216..9203592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Add on_schema_change possibility - Fix table materialization for Delta models - Change GlueColumn parent from base Column to SparkColumn +- Fix unraised DbtDatabaseError - Fix get_columns_in_relation function to stop returning additional partition columns ## v1.8.1 diff --git a/dbt/adapters/glue/gluedbapi/cursor.py b/dbt/adapters/glue/gluedbapi/cursor.py index faac8e4..2837246 100644 --- a/dbt/adapters/glue/gluedbapi/cursor.py +++ b/dbt/adapters/glue/gluedbapi/cursor.py @@ -3,6 +3,7 @@ import json from dbt.adapters.contracts.connection import AdapterResponse from dbt import exceptions as dbterrors +from dbt_common.exceptions import DbtDatabaseError from dbt.adapters.glue.gluedbapi.commons import GlueStatement from dbt.adapters.glue.util import get_pandas_dataframe_from_result_file from dbt.adapters.events.logging import AdapterLogger @@ -128,7 +129,7 @@ def execute(self, sql, bindings=None): logger.error(error_message) else: logger.debug(error_message) - raise dbterrors.DbtDatabaseError(msg=error_message) + raise DbtDatabaseError(msg=error_message) self.result = self.response if self.connection.use_arrow: @@ -143,11 +144,11 @@ def execute(self, sql, bindings=None): output = response.get("Statement", {}).get("Output", {}) error_message = f"Glue cursor returned `{output.get('Status')}` for statement {self.statement_id} for code {self.code}, {output.get('ErrorName')}: {output.get('ErrorValue')}" logger.debug(error_message) - raise dbterrors.DbtDatabaseError(msg=error_message) + raise DbtDatabaseError(msg=error_message) if self.state in [GlueCursorState.CANCELLED, GlueCursorState.CANCELLING]: self._post() - raise dbterrors.DbtDatabaseError( + raise DbtDatabaseError( msg=f"Statement {self.connection.session_id}.{self.statement_id} cancelled.") logger.debug("GlueCursor execute successfully")