Skip to content

Commit

Permalink
Fix: python model tests failed because python models don't have a
Browse files Browse the repository at this point in the history
query id or a cursor.

Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
Jesse Whitehouse committed Jun 28, 2023
1 parent 22fa8c9 commit c4c005a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,12 @@ def exponential_backoff(attempt: int) -> int:

@classmethod
def get_response(cls, cursor: DatabricksSQLCursorWrapper) -> DatabricksAdapterResponse:
query_id = cursor.hex_query_id
_query_id = getattr(cursor, "hex_query_id", None)
if cursor is None:
logger.debug("No cursor was provided. Query ID not available.")
query_id = "N/A"
else:
query_id = _query_id
message = "OK"
return DatabricksAdapterResponse(_message=message, query_id=query_id) # type: ignore

Expand Down

0 comments on commit c4c005a

Please sign in to comment.