mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-18 16:16:33 +00:00
community: Fix SQLDatabse.from_databricks issue when ran from Job (#24346)
- Description: When SQLDatabase.from_databricks is ran from a Databricks Workflow job, line 205 (default_host = context.browserHostName) throws an ``AttributeError`` as the ``context`` object has no ``browserHostName`` attribute. The fix handles the exception and sets the ``default_host`` variable to null --------- Co-authored-by: lmorosdb <lmorosdb> Co-authored-by: Eugene Yurtsev <eugene@langchain.dev>
This commit is contained in:
@@ -203,7 +203,7 @@ class SQLDatabase:
|
|||||||
|
|
||||||
context = get_context()
|
context = get_context()
|
||||||
default_host = context.browserHostName
|
default_host = context.browserHostName
|
||||||
except ImportError:
|
except (ImportError, AttributeError):
|
||||||
default_host = None
|
default_host = None
|
||||||
|
|
||||||
if host is None:
|
if host is None:
|
||||||
|
Reference in New Issue
Block a user