You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2023. It is now read-only.
I have Azure databricks running in two regions (US and UK). I have been using the databricks-sql-connector successfully to connect to Hive Metastore tables in each for some months. Currently the clusters are not running all the time, but if I use the databricks connector it first spins up the appropriate cluster. I would love to be able to use SQLAlchemy instead, however.
I tried your test setup in a Jupyter notebook, but get a Operational Error.
import numpy as np
import pandas as pd
import os
from sqlalchemy import *
from sqlalchemy.engine import create_engine
I have Azure databricks running in two regions (US and UK). I have been using the databricks-sql-connector successfully to connect to Hive Metastore tables in each for some months. Currently the clusters are not running all the time, but if I use the databricks connector it first spins up the appropriate cluster. I would love to be able to use SQLAlchemy instead, however.
I tried your test setup in a Jupyter notebook, but get a Operational Error.
import numpy as np
import pandas as pd
import os
from sqlalchemy import *
from sqlalchemy.engine import create_engine
def test_dialect(host, http_path, token):
engine = create_engine(
f"databricks+connector://token:{token}@{host}:443/default",
connect_args={"http_path": f"{http_path}"},
)
tables = inspect(engine).get_table_names()
print(tables)
region = "UK"
server_hostname= os.getenv(f'DATABRICKS_{region}HOSTNAME'),
http_path= os.getenv(f'DATABRICKS{region}HTTP'),
access_token = os.getenv(f'DATABRICKS{region}_TOKEN')
test_dialect(server_hostname, http_path, access_token)
gives:
OperationalError: (databricks.sql.exc.RequestError) Error during request to server
(Background on this error at: https://sqlalche.me/e/14/e3q8)
I do notice that this relies on PyHive, which is marked as unsupported.
The text was updated successfully, but these errors were encountered: