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 }}
Repository navigation
Inconsistent behavior listing schemas in UC catalogs depending on quoting #245
With a dev catalog containing default and my_schema schemas, I get different results depending on the name quoting:
importosfromdatabricksimportsqlhost=os.getenv("DATABRICKS_HOST")
http_path=os.getenv("DATABRICKS_HTTP_PATH")
access_token=os.getenv("DATABRICKS_TOKEN")
connection=sql.connect(
server_hostname=host,
http_path=http_path,
access_token=access_token)
cursor=connection.cursor()
print("> schemas('`dev`')")
cursor.schemas('`dev`') # quoted name, I get (global_temp) onlyresult=cursor.fetchall()
forrowinresult:
print(row)
print("> schemas('dev')")
cursor.schemas('dev') # unquoted name, I get (default, my_schema, global_temp)result=cursor.fetchall()
forrowinresult:
print(row)
cursor.close()
connection.close()
I'd expect the same behavior for both, since this is what dbt-databricks is apparently expecting too.
A unwanted side effect for dbt-databricks is databricks/dbt-databricks#464
This one isn't a bug. Metadata methods like cursor.schemas(...) take the plain stored name, not a SQL identifier, so backticks count as part of the name. Pass catalog_name="dev" rather than catalog_name="`dev`".
Activity
cathleeny commentedon Dec 3, 2026
This one isn't a bug. Metadata methods like
cursor.schemas(...)take the plain stored name, not a SQL identifier, so backticks count as part of the name. Passcatalog_name="dev"rather thancatalog_name="`dev`".