Skip to content

Commit fcab186

Browse files
Document completed async result retrieval
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent edd7608 commit fcab186

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/databricks/sql/backend/kernel/client.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ def get_execution_result(
957957
command_id: CommandId,
958958
cursor: "Cursor",
959959
) -> "ResultSet":
960+
"""Fetch results after the cursor has confirmed successful completion."""
960961
# Prefer the original owning async handle for the first
961962
# in-process result stream. The kernel attaches the real
962963
# ExecuteStatementAsync telemetry to that handle; attached

‎src/databricks/sql/backend/kernel/result_set.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- ``ExecutedStatement`` — returned by ``Statement.execute()``. Has a
77
``statement_id`` and a ``cancel()`` method.
88
- ``ResultStream`` — returned by ``Session.metadata().list_*`` and by
9-
``ExecutedAsyncStatement.await_result()``. No statement id; no
9+
``ExecutedAsyncStatement.fetch_result()`` after completion. No statement id; no
1010
cancel.
1111
1212
Both implement the same three methods this class actually calls:

‎tests/unit/test_kernel_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ def test_get_execution_result_construction_failure_retains_marker_and_uses_reade
15041504
c._kernel_session = MagicMock()
15051505
owning_stream = MagicMock()
15061506
# ``KernelResultSet.__init__`` calls ``arrow_schema()``; make that
1507-
# raise so ``_make_result_set`` fails after a successful await.
1507+
# raise so ``_make_result_set`` fails after a successful fetch.
15081508
owning_stream.arrow_schema.side_effect = _FakeKernelError(code="Internal")
15091509
owning_handle = MagicMock()
15101510
owning_handle.fetch_result.return_value = owning_stream

0 commit comments

Comments
 (0)