Skip to content

Commit

Permalink
Fixing Python-related timeouts (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db authored Jan 5, 2024
2 parents 4502121 + de25d4a commit 649f0f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## dbt-databricks 1.7.4 (TBD)

### Fixes

- Fix for issue where long-running python models led to invalid session errors ([544](https://github.com/databricks/dbt-databricks/pull/544))

## dbt-databricks 1.7.3 (Dec 12, 2023)

### Fixes
Expand Down
6 changes: 6 additions & 0 deletions dbt/adapters/databricks/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,12 @@ def _cleanup_idle_connections(self) -> None:
self.close(conn)
conn.handle = LazyHandle(self._open2)

def get_thread_connection(self) -> Connection:
if USE_LONG_SESSIONS:
self._cleanup_idle_connections()

return super().get_thread_connection()

def add_query(
self,
sql: str,
Expand Down

0 comments on commit 649f0f4

Please sign in to comment.