Skip to content

Commit 8b92820

Browse files
NiallEgansusodapop
authored andcommitted
Change default table_types to None
With UC, `table_types=[]` is interpreted differently than on HMS. On HMS, it means no filter applied, while on UC it means a filter of nothing applied, i.e. on UC we get the following: ``` cursor.tables(schema_name="taxi") 2>>> [] 3cursor.tables(schema_name="taxi", table_types=["TABLE", "VIEW"]) 4>>> [Row(TABLE_CAT='shant', TABLE_SCHEM='taxi', TABLE_NAME='trip_view', TABLE_TYPE='VIEW', REMARKS='', TYPE_CAT=None, TYPE_SCHEM=None, TYPE_NAME=None, SELF_REFERENCING_COL_NAME=None, REF_GENERATION=None), Row(TABLE_CAT='shant', TABLE_SCHEM='taxi', TABLE_NAME='trips', TABLE_TYPE='TABLE', REMARKS='', TYPE_CAT=None, TYPE_SCHEM=None, TYPE_NAME=None, SELF_REFERENCING_COL_NAME=None, REF_GENERATION=None)] ``` Change `table_types` to default to None to get all the table types by default.
1 parent 72c799b commit 8b92820

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

cmdexec/clients/python/src/databricks/sql/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ def tables(self,
295295
Names can contain % wildcards.
296296
:returns self
297297
"""
298-
if table_types is None:
299-
table_types = []
300298
self._check_not_closed()
301299
self._close_and_clear_active_result_set()
302300

cmdexec/clients/python/src/databricks/sql/thrift_backend.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,6 @@ def get_tables(self,
653653
schema_name=None,
654654
table_name=None,
655655
table_types=None):
656-
if table_types is None:
657-
table_types = []
658656
assert (session_handle is not None)
659657

660658
req = ttypes.TGetTablesReq(

0 commit comments

Comments
 (0)