|
25 | 25 | import logging |
26 | 26 | import threading |
27 | 27 | import uuid |
28 | | -from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING, Union |
| 28 | +from typing import Any, Dict, List, Optional, Set, TYPE_CHECKING, Union |
29 | 29 |
|
30 | 30 | from databricks.sql.backend.databricks_client import DatabricksClient |
31 | 31 | from databricks.sql.backend.kernel._errors import ( |
@@ -117,15 +117,6 @@ def _is_not_found(exc: BaseException) -> bool: |
117 | 117 | ) |
118 | 118 |
|
119 | 119 |
|
120 | | -def _exact_catalog_and_pattern( |
121 | | - catalog: Optional[str], pattern: Optional[str] |
122 | | -) -> Tuple[Optional[str], Optional[str]]: |
123 | | - """Avoid constructing the kernel's invalid empty ``Identifier``.""" |
124 | | - if catalog == "": |
125 | | - return None, "" |
126 | | - return catalog, pattern |
127 | | - |
128 | | - |
129 | 120 | def _is_staging_statement(operation: str) -> bool: |
130 | 121 | """True iff ``operation`` is a volume/staging statement (PUT / GET / |
131 | 122 | REMOVE). |
@@ -912,12 +903,9 @@ def get_schemas( |
912 | 903 | if self._kernel_session is None: |
913 | 904 | raise InterfaceError("get_schemas requires an open session.") |
914 | 905 | try: |
915 | | - catalog, schema_pattern = _exact_catalog_and_pattern( |
916 | | - catalog_name, schema_name |
917 | | - ) |
918 | 906 | stream = self._kernel_session.metadata().list_schemas( |
919 | | - catalog=catalog, |
920 | | - schema_pattern=schema_pattern, |
| 907 | + catalog=catalog_name, |
| 908 | + schema_pattern=schema_name, |
921 | 909 | ) |
922 | 910 | return self._make_result_set(stream, cursor, self._synthetic_command_id()) |
923 | 911 | except Exception as exc: |
@@ -972,12 +960,9 @@ def get_columns( |
972 | 960 | # row's `TABLE_CAT` is correctly attributed. Matches the |
973 | 961 | # Thrift backend's `getColumns(null, …)` behaviour from |
974 | 962 | # the user's perspective. |
975 | | - catalog, schema_pattern = _exact_catalog_and_pattern( |
976 | | - catalog_name, schema_name |
977 | | - ) |
978 | 963 | stream = self._kernel_session.metadata().list_columns( |
979 | | - catalog=catalog, |
980 | | - schema_pattern=schema_pattern, |
| 964 | + catalog=catalog_name, |
| 965 | + schema_pattern=schema_name, |
981 | 966 | table_pattern=table_name, |
982 | 967 | column_pattern=column_name, |
983 | 968 | ) |
|
0 commit comments