Skip to content

Commit 3f211ec

Browse files
authored
Merge pull request #3 from PeterDKay/task/alter-get-tables-for-UC
catalog in get_table_names adjusted with backquotes
2 parents 25b9aef + a3cf523 commit 3f211ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/databricks/sqlalchemy/dialect/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,13 @@ def get_indexes(self, connection, table_name, schema=None, **kw):
246246

247247
def get_table_names(self, connection, schema=None, **kwargs):
248248
TABLE_NAME = 1
249+
catalog = "`" + self.catalog + "`"
250+
249251
with self.get_driver_connection(
250252
connection
251253
)._dbapi_connection.dbapi_connection.cursor() as cur:
252254
sql_str = "SHOW TABLES FROM {}".format(
253-
".".join([self.catalog, schema or self.schema])
255+
".".join([catalog, schema or self.schema])
254256
)
255257
data = cur.execute(sql_str).fetchall()
256258
_tables = [i[TABLE_NAME] for i in data]

0 commit comments

Comments
 (0)