Skip to content

Commit 6297f7b

Browse files
clean up docstrings
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent d4ce10f commit 6297f7b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/databricks/sql/backend/databricks_client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ def execute_command(
9090
) -> Union["ResultSet", None]:
9191
"""
9292
Executes a SQL command or query within the specified session.
93+
9394
This method sends a SQL command to the server for execution and handles
9495
the response. It can operate in both synchronous and asynchronous modes.
96+
9597
Args:
9698
operation: The SQL command or query to execute
9799
session_id: The session identifier in which to execute the command
@@ -103,10 +105,12 @@ def execute_command(
103105
parameters: List of parameters to bind to the query
104106
async_op: Whether to execute the command asynchronously
105107
enforce_embedded_schema_correctness: Whether to enforce schema correctness
108+
106109
Returns:
107110
If async_op is False, returns an ExecuteResponse object containing the
108111
query results and metadata. If async_op is True, returns None and the
109112
results must be fetched later using get_execution_result().
113+
110114
Raises:
111115
ValueError: If the session ID is invalid
112116
OperationalError: If there's an error executing the command
@@ -177,13 +181,17 @@ def get_execution_result(
177181
) -> "ResultSet":
178182
"""
179183
Retrieves the results of a previously executed command.
184+
180185
This method fetches the results of a command that was executed asynchronously
181186
or retrieves additional results from a command that has more rows available.
187+
182188
Args:
183189
command_id: The command identifier for which to retrieve results
184190
cursor: The cursor object that will handle the results
191+
185192
Returns:
186193
ExecuteResponse: An object containing the query results and metadata
194+
187195
Raises:
188196
ValueError: If the command ID is invalid
189197
OperationalError: If there's an error retrieving the results
@@ -201,15 +209,19 @@ def get_catalogs(
201209
) -> "ResultSet":
202210
"""
203211
Retrieves a list of available catalogs.
212+
204213
This method fetches metadata about all catalogs available in the current
205214
session's context.
215+
206216
Args:
207217
session_id: The session identifier
208218
max_rows: Maximum number of rows to fetch in a single batch
209219
max_bytes: Maximum number of bytes to fetch in a single batch
210220
cursor: The cursor object that will handle the results
221+
211222
Returns:
212223
ExecuteResponse: An object containing the catalog metadata
224+
213225
Raises:
214226
ValueError: If the session ID is invalid
215227
OperationalError: If there's an error retrieving the catalogs
@@ -228,17 +240,21 @@ def get_schemas(
228240
) -> "ResultSet":
229241
"""
230242
Retrieves a list of schemas, optionally filtered by catalog and schema name patterns.
243+
231244
This method fetches metadata about schemas available in the specified catalog
232245
or all catalogs if no catalog is specified.
246+
233247
Args:
234248
session_id: The session identifier
235249
max_rows: Maximum number of rows to fetch in a single batch
236250
max_bytes: Maximum number of bytes to fetch in a single batch
237251
cursor: The cursor object that will handle the results
238252
catalog_name: Optional catalog name pattern to filter by
239253
schema_name: Optional schema name pattern to filter by
254+
240255
Returns:
241256
ExecuteResponse: An object containing the schema metadata
257+
242258
Raises:
243259
ValueError: If the session ID is invalid
244260
OperationalError: If there's an error retrieving the schemas
@@ -259,8 +275,10 @@ def get_tables(
259275
) -> "ResultSet":
260276
"""
261277
Retrieves a list of tables, optionally filtered by catalog, schema, table name, and table types.
278+
262279
This method fetches metadata about tables available in the specified catalog
263280
and schema, or all catalogs and schemas if not specified.
281+
264282
Args:
265283
session_id: The session identifier
266284
max_rows: Maximum number of rows to fetch in a single batch
@@ -270,8 +288,10 @@ def get_tables(
270288
schema_name: Optional schema name pattern to filter by
271289
table_name: Optional table name pattern to filter by
272290
table_types: Optional list of table types to filter by (e.g., ['TABLE', 'VIEW'])
291+
273292
Returns:
274293
ExecuteResponse: An object containing the table metadata
294+
275295
Raises:
276296
ValueError: If the session ID is invalid
277297
OperationalError: If there's an error retrieving the tables

0 commit comments

Comments
 (0)