88- Fetching metadata about catalogs, schemas, tables, and columns
99"""
1010
11+ from __future__ import annotations
12+
1113from abc import ABC , abstractmethod
12- from typing import Dict , Tuple , List , Optional , Any , Union , TYPE_CHECKING
14+ from typing import Dict , List , Optional , Any , Union , TYPE_CHECKING
1315
1416if TYPE_CHECKING :
1517 from databricks .sql .client import Cursor
18+ from databricks .sql .result_set import ResultSet
1619
1720from databricks .sql .thrift_api .TCLIService import ttypes
1821from databricks .sql .backend .types import SessionId , CommandId , CommandState
19- from databricks .sql .utils import ExecuteResponse
20- from databricks .sql .types import SSLOptions
21-
22- # Forward reference for type hints
23- from typing import TYPE_CHECKING
24-
25- if TYPE_CHECKING :
26- from databricks .sql .result_set import ResultSet
2722
2823
2924class DatabricksClient (ABC ):
@@ -82,12 +77,12 @@ def execute_command(
8277 max_rows : int ,
8378 max_bytes : int ,
8479 lz4_compression : bool ,
85- cursor : " Cursor" ,
80+ cursor : Cursor ,
8681 use_cloud_fetch : bool ,
8782 parameters : List [ttypes .TSparkParameter ],
8883 async_op : bool ,
8984 enforce_embedded_schema_correctness : bool ,
90- ) -> Union [" ResultSet" , None ]:
85+ ) -> Union [ResultSet , None ]:
9186 """
9287 Executes a SQL command or query within the specified session.
9388
@@ -177,8 +172,8 @@ def get_query_state(self, command_id: CommandId) -> CommandState:
177172 def get_execution_result (
178173 self ,
179174 command_id : CommandId ,
180- cursor : " Cursor" ,
181- ) -> " ResultSet" :
175+ cursor : Cursor ,
176+ ) -> ResultSet :
182177 """
183178 Retrieves the results of a previously executed command.
184179
@@ -205,8 +200,8 @@ def get_catalogs(
205200 session_id : SessionId ,
206201 max_rows : int ,
207202 max_bytes : int ,
208- cursor : " Cursor" ,
209- ) -> " ResultSet" :
203+ cursor : Cursor ,
204+ ) -> ResultSet :
210205 """
211206 Retrieves a list of available catalogs.
212207
@@ -234,10 +229,10 @@ def get_schemas(
234229 session_id : SessionId ,
235230 max_rows : int ,
236231 max_bytes : int ,
237- cursor : " Cursor" ,
232+ cursor : Cursor ,
238233 catalog_name : Optional [str ] = None ,
239234 schema_name : Optional [str ] = None ,
240- ) -> " ResultSet" :
235+ ) -> ResultSet :
241236 """
242237 Retrieves a list of schemas, optionally filtered by catalog and schema name patterns.
243238
@@ -267,12 +262,12 @@ def get_tables(
267262 session_id : SessionId ,
268263 max_rows : int ,
269264 max_bytes : int ,
270- cursor : " Cursor" ,
265+ cursor : Cursor ,
271266 catalog_name : Optional [str ] = None ,
272267 schema_name : Optional [str ] = None ,
273268 table_name : Optional [str ] = None ,
274269 table_types : Optional [List [str ]] = None ,
275- ) -> " ResultSet" :
270+ ) -> ResultSet :
276271 """
277272 Retrieves a list of tables, optionally filtered by catalog, schema, table name, and table types.
278273
@@ -304,12 +299,12 @@ def get_columns(
304299 session_id : SessionId ,
305300 max_rows : int ,
306301 max_bytes : int ,
307- cursor : " Cursor" ,
302+ cursor : Cursor ,
308303 catalog_name : Optional [str ] = None ,
309304 schema_name : Optional [str ] = None ,
310305 table_name : Optional [str ] = None ,
311306 column_name : Optional [str ] = None ,
312- ) -> " ResultSet" :
307+ ) -> ResultSet :
313308 """
314309 Retrieves a list of columns, optionally filtered by catalog, schema, table, and column name patterns.
315310
0 commit comments