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

Skip to content

Commit a799ee7

Browse files
authored
Merge pull request #8 from sede-open/task/exclude-views-from-get-table-names
Removed commented out old method
2 parents 84318f4 + b348193 commit a799ee7

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/databricks/sqlalchemy/dialect/__init__.py

+1-17
Original file line numberDiff line numberDiff line change
@@ -259,28 +259,12 @@ def get_table_names(self, connection, schema=None, **kwargs):
259259
AND table_type = 'MANAGED';""".format(
260260
schema_str
261261
)
262+
# TODO: Add if scenario for None schema
262263
data = cur.execute(sql_str).fetchall()
263264
_tables = [i[TABLE_NAME] for i in data]
264265

265266
return _tables
266267

267-
# TODO: Commented out this until can be deleted after successful tests
268-
# def get_table_names(self, connection, schema=None, **kwargs):
269-
# TABLE_NAME = 1
270-
# catalog = "`" + self.catalog + "`"
271-
# schema = ("`" + schema + "`") or ("`" + self.schema + "`")
272-
#
273-
# with self.get_driver_connection(
274-
# connection
275-
# )._dbapi_connection.dbapi_connection.cursor() as cur:
276-
# sql_str = "SHOW TABLES FROM {}".format(
277-
# ".".join([catalog, schema])
278-
# )
279-
# data = cur.execute(sql_str).fetchall()
280-
# _tables = [i[TABLE_NAME] for i in data]
281-
#
282-
# return _tables
283-
284268
def get_view_names(self, connection, schema=None, **kwargs):
285269
VIEW_NAME = 1
286270
with self.get_driver_connection(

0 commit comments

Comments
 (0)