mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 07:35:18 +00:00
community[patch]: Fix sql_databse.from_databricks issue when ran from Job (#23224)
**Desscription**: When the ``sql_database.from_databricks`` is executed from a Workflow Job, the ``context`` object does not have a "browserHostName" property, resulting in an error. This change manages the error so the "DATABRICKS_HOST" env variable value is used instead of stoping the flow Co-authored-by: lmorosdb <lmorosdb>
This commit is contained in:
parent
cd6812342e
commit
d5be160af0
@ -201,10 +201,10 @@ class SQLDatabase:
|
||||
from dbruntime.databricks_repl_context import get_context
|
||||
|
||||
context = get_context()
|
||||
default_host = context.browserHostName
|
||||
except ImportError:
|
||||
pass
|
||||
default_host = None
|
||||
|
||||
default_host = context.browserHostName if context else None
|
||||
if host is None:
|
||||
host = get_from_env("host", "DATABRICKS_HOST", default_host)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user