Closed
Description
It works if I pass the schema to create_engine
and call has_table
with no schema. I think this could be fixed by changing line 285 to reflect the schema here:
Example python script:
import os
import sqlalchemy as sa
host = os.getenv("DATABRICKS_SERVER_HOSTNAME")
http_path = os.getenv("DATABRICKS_HTTP_PATH")
access_token = os.getenv("DATABRICKS_TOKEN")
catalog = os.getenv("DATABRICKS_CATALOG")
engine = sa.create_engine(f"databricks://token:{access_token}@{host}?http_path={http_path}&catalog={catalog}&schema=temp")
with engine.connect() as conn:
conn.exec_driver_sql("drop table if exists chuck_test;")
conn.exec_driver_sql("create table chuck_test (a int);")
assert sa.inspect(conn).has_table("chuck_test")
engine = sa.create_engine(f"databricks://token:{access_token}@{host}?http_path={http_path}&catalog={catalog}")
with engine.connect() as conn:
assert sa.inspect(conn).has_table("chuck_test", schema="temp")
Output:
Traceback (most recent call last):
File "C:\temp\test_databricks.py", line 17, in <module>
assert sa.inspect(conn).has_table("chuck_test", schema="temp")
AssertionError
Metadata
Metadata
Assignees
Labels
No labels