@@ -33,18 +33,18 @@ def open_session(
33
33
) -> SessionId :
34
34
"""
35
35
Opens a new session with the Databricks SQL service.
36
-
36
+
37
37
This method establishes a new session with the server and returns a session
38
38
identifier that can be used for subsequent operations.
39
-
39
+
40
40
Args:
41
41
session_configuration: Optional dictionary of configuration parameters for the session
42
42
catalog: Optional catalog name to use as the initial catalog for the session
43
43
schema: Optional schema name to use as the initial schema for the session
44
-
44
+
45
45
Returns:
46
46
SessionId: A session identifier object that can be used for subsequent operations
47
-
47
+
48
48
Raises:
49
49
Error: If the session configuration is invalid
50
50
OperationalError: If there's an error establishing the session
@@ -56,13 +56,13 @@ def open_session(
56
56
def close_session (self , session_id : SessionId ) -> None :
57
57
"""
58
58
Closes an existing session with the Databricks SQL service.
59
-
59
+
60
60
This method terminates the session identified by the given session ID and
61
61
releases any resources associated with it.
62
-
62
+
63
63
Args:
64
64
session_id: The session identifier returned by open_session()
65
-
65
+
66
66
Raises:
67
67
ValueError: If the session ID is invalid
68
68
OperationalError: If there's an error closing the session
@@ -86,10 +86,10 @@ def execute_command(
86
86
) -> Any :
87
87
"""
88
88
Executes a SQL command or query within the specified session.
89
-
89
+
90
90
This method sends a SQL command to the server for execution and handles
91
91
the response. It can operate in both synchronous and asynchronous modes.
92
-
92
+
93
93
Args:
94
94
operation: The SQL command or query to execute
95
95
session_id: The session identifier in which to execute the command
@@ -101,12 +101,12 @@ def execute_command(
101
101
parameters: List of parameters to bind to the query
102
102
async_op: Whether to execute the command asynchronously
103
103
enforce_embedded_schema_correctness: Whether to enforce schema correctness
104
-
104
+
105
105
Returns:
106
106
If async_op is False, returns an ExecuteResponse object containing the
107
107
query results and metadata. If async_op is True, returns None and the
108
108
results must be fetched later using get_execution_result().
109
-
109
+
110
110
Raises:
111
111
ValueError: If the session ID is invalid
112
112
OperationalError: If there's an error executing the command
@@ -118,13 +118,13 @@ def execute_command(
118
118
def cancel_command (self , command_id : CommandId ) -> None :
119
119
"""
120
120
Cancels a running command or query.
121
-
121
+
122
122
This method attempts to cancel a command that is currently being executed.
123
123
It can be called from a different thread than the one executing the command.
124
-
124
+
125
125
Args:
126
126
command_id: The command identifier to cancel
127
-
127
+
128
128
Raises:
129
129
ValueError: If the command ID is invalid
130
130
OperationalError: If there's an error canceling the command
@@ -135,16 +135,16 @@ def cancel_command(self, command_id: CommandId) -> None:
135
135
def close_command (self , command_id : CommandId ) -> ttypes .TStatus :
136
136
"""
137
137
Closes a command and releases associated resources.
138
-
138
+
139
139
This method informs the server that the client is done with the command
140
140
and any resources associated with it can be released.
141
-
141
+
142
142
Args:
143
143
command_id: The command identifier to close
144
-
144
+
145
145
Returns:
146
146
ttypes.TStatus: The status of the close operation
147
-
147
+
148
148
Raises:
149
149
ValueError: If the command ID is invalid
150
150
OperationalError: If there's an error closing the command
@@ -155,15 +155,15 @@ def close_command(self, command_id: CommandId) -> ttypes.TStatus:
155
155
def get_query_state (self , command_id : CommandId ) -> ttypes .TOperationState :
156
156
"""
157
157
Gets the current state of a query or command.
158
-
158
+
159
159
This method retrieves the current execution state of a command from the server.
160
-
160
+
161
161
Args:
162
162
command_id: The command identifier to check
163
-
163
+
164
164
Returns:
165
165
ttypes.TOperationState: The current state of the command
166
-
166
+
167
167
Raises:
168
168
ValueError: If the command ID is invalid
169
169
OperationalError: If there's an error retrieving the state
@@ -180,17 +180,17 @@ def get_execution_result(
180
180
) -> ExecuteResponse :
181
181
"""
182
182
Retrieves the results of a previously executed command.
183
-
183
+
184
184
This method fetches the results of a command that was executed asynchronously
185
185
or retrieves additional results from a command that has more rows available.
186
-
186
+
187
187
Args:
188
188
command_id: The command identifier for which to retrieve results
189
189
cursor: The cursor object that will handle the results
190
-
190
+
191
191
Returns:
192
192
ExecuteResponse: An object containing the query results and metadata
193
-
193
+
194
194
Raises:
195
195
ValueError: If the command ID is invalid
196
196
OperationalError: If there's an error retrieving the results
@@ -208,19 +208,19 @@ def get_catalogs(
208
208
) -> ExecuteResponse :
209
209
"""
210
210
Retrieves a list of available catalogs.
211
-
211
+
212
212
This method fetches metadata about all catalogs available in the current
213
213
session's context.
214
-
214
+
215
215
Args:
216
216
session_id: The session identifier
217
217
max_rows: Maximum number of rows to fetch in a single batch
218
218
max_bytes: Maximum number of bytes to fetch in a single batch
219
219
cursor: The cursor object that will handle the results
220
-
220
+
221
221
Returns:
222
222
ExecuteResponse: An object containing the catalog metadata
223
-
223
+
224
224
Raises:
225
225
ValueError: If the session ID is invalid
226
226
OperationalError: If there's an error retrieving the catalogs
@@ -239,21 +239,21 @@ def get_schemas(
239
239
) -> ExecuteResponse :
240
240
"""
241
241
Retrieves a list of schemas, optionally filtered by catalog and schema name patterns.
242
-
242
+
243
243
This method fetches metadata about schemas available in the specified catalog
244
244
or all catalogs if no catalog is specified.
245
-
245
+
246
246
Args:
247
247
session_id: The session identifier
248
248
max_rows: Maximum number of rows to fetch in a single batch
249
249
max_bytes: Maximum number of bytes to fetch in a single batch
250
250
cursor: The cursor object that will handle the results
251
251
catalog_name: Optional catalog name pattern to filter by
252
252
schema_name: Optional schema name pattern to filter by
253
-
253
+
254
254
Returns:
255
255
ExecuteResponse: An object containing the schema metadata
256
-
256
+
257
257
Raises:
258
258
ValueError: If the session ID is invalid
259
259
OperationalError: If there's an error retrieving the schemas
@@ -274,10 +274,10 @@ def get_tables(
274
274
) -> ExecuteResponse :
275
275
"""
276
276
Retrieves a list of tables, optionally filtered by catalog, schema, table name, and table types.
277
-
277
+
278
278
This method fetches metadata about tables available in the specified catalog
279
279
and schema, or all catalogs and schemas if not specified.
280
-
280
+
281
281
Args:
282
282
session_id: The session identifier
283
283
max_rows: Maximum number of rows to fetch in a single batch
@@ -287,10 +287,10 @@ def get_tables(
287
287
schema_name: Optional schema name pattern to filter by
288
288
table_name: Optional table name pattern to filter by
289
289
table_types: Optional list of table types to filter by (e.g., ['TABLE', 'VIEW'])
290
-
290
+
291
291
Returns:
292
292
ExecuteResponse: An object containing the table metadata
293
-
293
+
294
294
Raises:
295
295
ValueError: If the session ID is invalid
296
296
OperationalError: If there's an error retrieving the tables
@@ -311,10 +311,10 @@ def get_columns(
311
311
) -> ExecuteResponse :
312
312
"""
313
313
Retrieves a list of columns, optionally filtered by catalog, schema, table, and column name patterns.
314
-
314
+
315
315
This method fetches metadata about columns available in the specified table,
316
316
or all tables if not specified.
317
-
317
+
318
318
Args:
319
319
session_id: The session identifier
320
320
max_rows: Maximum number of rows to fetch in a single batch
@@ -324,10 +324,10 @@ def get_columns(
324
324
schema_name: Optional schema name pattern to filter by
325
325
table_name: Optional table name pattern to filter by
326
326
column_name: Optional column name pattern to filter by
327
-
327
+
328
328
Returns:
329
329
ExecuteResponse: An object containing the column metadata
330
-
330
+
331
331
Raises:
332
332
ValueError: If the session ID is invalid
333
333
OperationalError: If there's an error retrieving the columns
@@ -340,7 +340,7 @@ def get_columns(
340
340
def staging_allowed_local_path (self ) -> Union [None , str , List [str ]]:
341
341
"""
342
342
Gets the allowed local paths for staging operations.
343
-
343
+
344
344
Returns:
345
345
Union[None, str, List[str]]: The allowed local paths for staging operations,
346
346
or None if staging is not allowed
@@ -352,7 +352,7 @@ def staging_allowed_local_path(self) -> Union[None, str, List[str]]:
352
352
def ssl_options (self ) -> SSLOptions :
353
353
"""
354
354
Gets the SSL options for this client.
355
-
355
+
356
356
Returns:
357
357
SSLOptions: The SSL configuration options
358
358
"""
@@ -363,8 +363,8 @@ def ssl_options(self) -> SSLOptions:
363
363
def max_download_threads (self ) -> int :
364
364
"""
365
365
Gets the maximum number of download threads for cloud fetch operations.
366
-
366
+
367
367
Returns:
368
368
int: The maximum number of download threads
369
369
"""
370
- pass
370
+ pass
0 commit comments