Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62c7931

Browse files
committed
get tables function modified
1 parent 3f211ec commit 62c7931

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/databricks/sqlalchemy/dialect/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,13 @@ def get_indexes(self, connection, table_name, schema=None, **kw):
247247
def get_table_names(self, connection, schema=None, **kwargs):
248248
TABLE_NAME = 1
249249
catalog = "`" + self.catalog + "`"
250+
schema = ("`" + schema + "`") or ("`" + self.schema + "`")
250251

251252
with self.get_driver_connection(
252253
connection
253254
)._dbapi_connection.dbapi_connection.cursor() as cur:
254255
sql_str = "SHOW TABLES FROM {}".format(
255-
".".join([catalog, schema or self.schema])
256+
".".join([catalog, schema])
256257
)
257258
data = cur.execute(sql_str).fetchall()
258259
_tables = [i[TABLE_NAME] for i in data]

0 commit comments

Comments
 (0)