@@ -1285,20 +1285,20 @@ def test_close_command_tolerant_when_handle_missing():
12851285 c .close_command (fake_command_id ) # must not raise
12861286
12871287
1288- def _attach_returns (c , * , status = None , status_error = None , await_result = None ):
1288+ def _attach_returns (c , * , status = None , status_error = None , fetch_result = None ):
12891289 """Wire ``_kernel_session.attach_async_statement`` to return a fake
12901290 handle. ``status`` is a ``(state, failure)`` tuple for ``handle.status()``;
12911291 ``status_error`` makes ``attach`` itself raise (e.g. NotFound);
1292- ``await_result `` sets ``handle.await_result ()`` return value."""
1292+ ``fetch_result `` sets ``handle.fetch_result ()`` return value."""
12931293 c ._kernel_session = MagicMock ()
12941294 if status_error is not None :
12951295 c ._kernel_session .attach_async_statement .side_effect = status_error
12961296 return None
12971297 handle = MagicMock ()
12981298 if status is not None :
12991299 handle .status .return_value = status
1300- if await_result is not None :
1301- handle .await_result .return_value = await_result
1300+ if fetch_result is not None :
1301+ handle .fetch_result .return_value = fetch_result
13021302 c ._kernel_session .attach_async_statement .return_value = handle
13031303 return handle
13041304
@@ -1319,7 +1319,7 @@ def test_get_query_state_returns_succeeded_when_server_404s():
13191319def test_independent_async_read_requires_reader_api (read_result ):
13201320 c = _make_client ()
13211321 c ._kernel_session = MagicMock ()
1322- owner = MagicMock (spec = ["status" , "await_result " ])
1322+ owner = MagicMock (spec = ["status" , "fetch_result " ])
13231323 cid = CommandId .from_sea_statement_id ("tracked-async" )
13241324 c ._async_handles [cid .guid ] = owner
13251325 c ._async_result_stream_started .add (cid .guid )
@@ -1440,7 +1440,7 @@ def test_get_execution_result_uses_retained_owning_handle_first():
14401440 fake_stream = MagicMock ()
14411441 fake_stream .arrow_schema .return_value = pa .schema ([("n" , pa .int64 ())])
14421442 handle = MagicMock ()
1443- handle .await_result .return_value = fake_stream
1443+ handle .fetch_result .return_value = fake_stream
14441444 cursor = MagicMock ()
14451445 cursor .arraysize = 100
14461446 cursor .buffer_size_bytes = 1024
@@ -1452,7 +1452,7 @@ def test_get_execution_result_uses_retained_owning_handle_first():
14521452
14531453 assert rs is not None
14541454 c ._kernel_session .attach_async_statement .assert_not_called ()
1455- handle .await_result .assert_called_once_with ()
1455+ handle .fetch_result .assert_called_once_with ()
14561456 assert cid .guid in c ._async_result_stream_started
14571457
14581458
@@ -1462,7 +1462,7 @@ def test_get_execution_result_attaches_by_id_when_no_retained_handle():
14621462 c = _make_client ()
14631463 fake_stream = MagicMock ()
14641464 fake_stream .arrow_schema .return_value = pa .schema ([("n" , pa .int64 ())])
1465- handle = _attach_returns (c , await_result = fake_stream )
1465+ handle = _attach_returns (c , fetch_result = fake_stream )
14661466 cursor = MagicMock ()
14671467 cursor .arraysize = 100
14681468 cursor .buffer_size_bytes = 1024
@@ -1472,7 +1472,7 @@ def test_get_execution_result_attaches_by_id_when_no_retained_handle():
14721472
14731473 assert rs is not None
14741474 c ._kernel_session .attach_async_statement .assert_called_once_with ("async-1" )
1475- handle .await_result .assert_called_once_with ()
1475+ handle .fetch_result .assert_called_once_with ()
14761476
14771477
14781478def test_get_execution_result_owning_handle_failure_can_retry_owning_handle ():
@@ -1482,7 +1482,7 @@ def test_get_execution_result_owning_handle_failure_can_retry_owning_handle():
14821482 c = _make_client ()
14831483 c ._kernel_session = MagicMock ()
14841484 handle = MagicMock ()
1485- handle .await_result .side_effect = _FakeKernelError (code = "Unavailable" )
1485+ handle .fetch_result .side_effect = _FakeKernelError (code = "Unavailable" )
14861486 cid = CommandId .from_sea_statement_id ("async-retry-owning" )
14871487 c ._async_handles [cid .guid ] = handle
14881488
@@ -1494,11 +1494,11 @@ def test_get_execution_result_owning_handle_failure_can_retry_owning_handle():
14941494
14951495
14961496def test_get_execution_result_construction_failure_retains_marker_and_uses_reader ():
1497- """If the owning handle's ``await_result ()`` succeeds but result-set
1497+ """If the owning handle's ``fetch_result ()`` succeeds but result-set
14981498 construction then raises, the ``_async_result_stream_started`` marker
14991499 is deliberately left set (the owning stream may be partially
1500- consumed, so re-awaiting it is unsafe). A subsequent call must route
1501- through the derived reader fallback rather than re-awaiting the owning
1500+ consumed, so re-fetching it is unsafe). A subsequent call must route
1501+ through the derived reader fallback rather than re-fetching the owning
15021502 handle."""
15031503 c = _make_client ()
15041504 c ._kernel_session = MagicMock ()
@@ -1507,7 +1507,7 @@ def test_get_execution_result_construction_failure_retains_marker_and_uses_reade
15071507 # raise so ``_make_result_set`` fails after a successful await.
15081508 owning_stream .arrow_schema .side_effect = _FakeKernelError (code = "Internal" )
15091509 owning_handle = MagicMock ()
1510- owning_handle .await_result .return_value = owning_stream
1510+ owning_handle .fetch_result .return_value = owning_stream
15111511 cid = CommandId .from_sea_statement_id ("async-construct-fail" )
15121512 c ._async_handles [cid .guid ] = owning_handle
15131513
@@ -1516,15 +1516,15 @@ def test_get_execution_result_construction_failure_retains_marker_and_uses_reade
15161516
15171517 # Marker stays set even though construction failed.
15181518 assert cid .guid in c ._async_result_stream_started
1519- owning_handle .await_result .assert_called_once_with ()
1519+ owning_handle .fetch_result .assert_called_once_with ()
15201520 c ._kernel_session .attach_async_statement .assert_not_called ()
15211521
1522- # A retry derives a reader (fresh stream) instead of re-awaiting
1522+ # A retry derives a reader (fresh stream) instead of re-fetching
15231523 # the partially-consumed owning handle.
15241524 retry_stream = MagicMock ()
15251525 retry_stream .arrow_schema .return_value = pa .schema ([("n" , pa .int64 ())])
15261526 reader = MagicMock ()
1527- reader .await_result .return_value = retry_stream
1527+ reader .fetch_result .return_value = retry_stream
15281528 owning_handle .reader .return_value = reader
15291529 cursor = MagicMock ()
15301530 cursor .arraysize = 100
@@ -1535,9 +1535,9 @@ def test_get_execution_result_construction_failure_retains_marker_and_uses_reade
15351535 assert rs is not None
15361536 owning_handle .reader .assert_called_once_with ()
15371537 c ._kernel_session .attach_async_statement .assert_not_called ()
1538- reader .await_result .assert_called_once_with ()
1539- # The owning handle was not re-awaited on the retry.
1540- owning_handle .await_result .assert_called_once_with ()
1538+ reader .fetch_result .assert_called_once_with ()
1539+ # The owning handle was not re-fetched on the retry.
1540+ owning_handle .fetch_result .assert_called_once_with ()
15411541
15421542
15431543def test_get_execution_result_maps_not_found_to_programming_error ():
@@ -1779,9 +1779,9 @@ def test_get_execution_result_is_re_callable():
17791779 fake_stream = MagicMock ()
17801780 fake_stream .arrow_schema .return_value = pa .schema ([("n" , pa .int64 ())])
17811781 owning_handle = MagicMock ()
1782- owning_handle .await_result .return_value = fake_stream
1782+ owning_handle .fetch_result .return_value = fake_stream
17831783 reader = MagicMock ()
1784- reader .await_result .return_value = fake_stream
1784+ reader .fetch_result .return_value = fake_stream
17851785 owning_handle .reader .return_value = reader
17861786 cid = CommandId .from_sea_statement_id ("async-recall-twice" )
17871787 c ._async_handles [cid .guid ] = owning_handle
@@ -1793,10 +1793,10 @@ def test_get_execution_result_is_re_callable():
17931793 rs2 = c .get_execution_result (cid , cursor = cursor )
17941794
17951795 assert rs1 is not None and rs2 is not None
1796- owning_handle .await_result .assert_called_once_with ()
1796+ owning_handle .fetch_result .assert_called_once_with ()
17971797 owning_handle .reader .assert_called_once_with ()
17981798 c ._kernel_session .attach_async_statement .assert_not_called ()
1799- reader .await_result .assert_called_once_with ()
1799+ reader .fetch_result .assert_called_once_with ()
18001800
18011801
18021802# ---------------------------------------------------------------------------
0 commit comments