1717 async_to_streamed_response_wrapper ,
1818)
1919from ..._constants import DEFAULT_TIMEOUT
20+ from ..._exceptions import APIStatusError
2021from ...lib .polling import PollingConfig , poll_until
2122from ..._base_client import make_request_options
2223from ...types .devboxes import execution_retrieve_params , execution_execute_sync_params , execution_execute_async_params
2324from ...lib .polling_async import async_poll_until
2425from ...types .devbox_execution_detail_view import DevboxExecutionDetailView
2526from ...types .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView
26- from ..._exceptions import APIStatusError
2727
2828__all__ = ["ExecutionsResource" , "AsyncExecutionsResource" ]
2929
@@ -106,7 +106,7 @@ def await_completed(
106106 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
107107 ) -> DevboxAsyncExecutionDetailView :
108108 """Wait for an execution to complete.
109-
109+
110110 Args:
111111 execution_id: The ID of the execution to wait for
112112 id: The ID of the devbox
@@ -133,7 +133,7 @@ def wait_for_execution_status() -> DevboxAsyncExecutionDetailView:
133133 ),
134134 cast_to = DevboxAsyncExecutionDetailView ,
135135 )
136-
136+
137137 def handle_timeout_error (error : Exception ) -> DevboxAsyncExecutionDetailView :
138138 # Handle 408 timeout errors by returning current execution state to continue polling
139139 if isinstance (error , APIStatusError ) and error .response .status_code == 408 :
@@ -150,9 +150,9 @@ def handle_timeout_error(error: Exception) -> DevboxAsyncExecutionDetailView:
150150 raise error
151151
152152 def is_done (execution : DevboxAsyncExecutionDetailView ) -> bool :
153- return execution .status == ' completed'
153+ return execution .status == " completed"
154154
155- return poll_until (wait_for_execution_status , is_done , config , handle_timeout_error )
155+ return poll_until (wait_for_execution_status , is_done , config , handle_timeout_error )
156156
157157 def execute_async (
158158 self ,
@@ -387,7 +387,7 @@ async def retrieve(
387387
388388 async def await_completed (
389389 self ,
390- execution_id : str ,
390+ execution_id : str ,
391391 * ,
392392 devbox_id : str ,
393393 polling_config : PollingConfig | None = None ,
@@ -399,7 +399,7 @@ async def await_completed(
399399 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
400400 ) -> DevboxAsyncExecutionDetailView :
401401 """Wait for an execution to complete.
402-
402+
403403 Args:
404404 execution_id: The ID of the execution to wait for
405405 id: The ID of the devbox
@@ -415,6 +415,7 @@ async def await_completed(
415415 Raises:
416416 PollingTimeout: If polling times out before execution completes
417417 """
418+
418419 async def wait_for_execution_status () -> DevboxAsyncExecutionDetailView :
419420 try :
420421 return await self ._post (
@@ -440,8 +441,8 @@ async def wait_for_execution_status() -> DevboxAsyncExecutionDetailView:
440441 raise
441442
442443 def is_done (execution : DevboxAsyncExecutionDetailView ) -> bool :
443- return execution .status == ' completed'
444-
444+ return execution .status == " completed"
445+
445446 return await async_poll_until (wait_for_execution_status , is_done , polling_config )
446447
447448 async def execute_async (
0 commit comments