From b3481934f861da24e6b03ba1bd67d212d4c86608 Mon Sep 17 00:00:00 2001 From: Peter Kay Date: Mon, 7 Aug 2023 20:48:02 +0100 Subject: [PATCH] Removed commented out old method --- src/databricks/sqlalchemy/dialect/__init__.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/databricks/sqlalchemy/dialect/__init__.py b/src/databricks/sqlalchemy/dialect/__init__.py index f4e5eaf38..dd3abbcdc 100644 --- a/src/databricks/sqlalchemy/dialect/__init__.py +++ b/src/databricks/sqlalchemy/dialect/__init__.py @@ -259,28 +259,12 @@ def get_table_names(self, connection, schema=None, **kwargs): AND table_type = 'MANAGED';""".format( schema_str ) + # TODO: Add if scenario for None schema data = cur.execute(sql_str).fetchall() _tables = [i[TABLE_NAME] for i in data] return _tables - # TODO: Commented out this until can be deleted after successful tests - # def get_table_names(self, connection, schema=None, **kwargs): - # TABLE_NAME = 1 - # catalog = "`" + self.catalog + "`" - # schema = ("`" + schema + "`") or ("`" + self.schema + "`") - # - # with self.get_driver_connection( - # connection - # )._dbapi_connection.dbapi_connection.cursor() as cur: - # sql_str = "SHOW TABLES FROM {}".format( - # ".".join([catalog, schema]) - # ) - # data = cur.execute(sql_str).fetchall() - # _tables = [i[TABLE_NAME] for i in data] - # - # return _tables - def get_view_names(self, connection, schema=None, **kwargs): VIEW_NAME = 1 with self.get_driver_connection(