Skip to content

Commit 0173013

Browse files
committed
Merge branch 'main' into 1.7.latest
2 parents 40ffcd6 + 7873a6d commit 0173013

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## dbt-databricks 1.7.15 (TBD)
1+
## dbt-databricks 1.7.15 (May 16, 2024)
2+
3+
### Fixes
4+
5+
- Give sensible logs when connection errors ([666](https://github.com/databricks/dbt-databricks/pull/666))
26

37
## dbt-databricks 1.7.14 (May 1, 2024)
48

dbt/adapters/databricks/events/connection_events.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from abc import ABC
2+
from typing import Any
23
from typing import Optional
34
from typing import Tuple
45

56
from databricks.sql.client import Connection
67
from dbt.adapters.databricks.events.base import SQLErrorEvent
7-
from dbt.contracts.graph.nodes import ResultNode
88

99

1010
class ConnectionEvent(ABC):
11-
def __init__(self, connection: Connection, message: str):
11+
def __init__(self, connection: Optional[Connection], message: str):
1212
self.message = message
1313
self.session_id = "Unknown"
1414
if connection:
@@ -19,31 +19,31 @@ def __str__(self) -> str:
1919

2020

2121
class ConnectionCancel(ConnectionEvent):
22-
def __init__(self, connection: Connection):
22+
def __init__(self, connection: Optional[Connection]):
2323
super().__init__(connection, "Cancelling connection")
2424

2525

2626
class ConnectionClose(ConnectionEvent):
27-
def __init__(self, connection: Connection):
27+
def __init__(self, connection: Optional[Connection]):
2828
super().__init__(connection, "Closing connection")
2929

3030

3131
class ConnectionCancelError(ConnectionEvent):
32-
def __init__(self, connection: Connection, exception: Exception):
32+
def __init__(self, connection: Optional[Connection], exception: Exception):
3333
super().__init__(
3434
connection, str(SQLErrorEvent(exception, "Exception while trying to cancel connection"))
3535
)
3636

3737

3838
class ConnectionCloseError(ConnectionEvent):
39-
def __init__(self, connection: Connection, exception: Exception):
39+
def __init__(self, connection: Optional[Connection], exception: Exception):
4040
super().__init__(
4141
connection, str(SQLErrorEvent(exception, "Exception while trying to close connection"))
4242
)
4343

4444

4545
class ConnectionCreateError(ConnectionEvent):
46-
def __init__(self, connection: Connection, exception: Exception):
46+
def __init__(self, connection: Optional[Connection], exception: Exception):
4747
super().__init__(
4848
connection, str(SQLErrorEvent(exception, "Exception while trying to create connection"))
4949
)
@@ -62,7 +62,7 @@ class ConnectionAcquire(ConnectionWrapperEvent):
6262
def __init__(
6363
self,
6464
description: str,
65-
model: Optional[ResultNode],
65+
model: Optional[Any],
6666
compute_name: Optional[str],
6767
thread_identifier: Tuple[int, int],
6868
):

0 commit comments

Comments
 (0)