Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rculbertson committed Dec 10, 2024
1 parent 026efb7 commit 33ebf45
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modal/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async def pop_function_call_outputs(
)

if response.lost_input_ids:
raise LostInputsError(response.lost_input_ids)
raise LostInputsError(list(response.lost_input_ids))

if len(response.outputs) > 0:
return response
Expand Down Expand Up @@ -233,7 +233,9 @@ async def _get_single_output(self, expected_input_id: Optional[str] = None) -> A
# waits indefinitely for a single result for the function, and clear the outputs buffer after
item: api_pb2.FunctionGetOutputsItem = (
await self.pop_function_call_outputs(
timeout=None, clear_on_success=True, expected_input_ids=[expected_input_id]
timeout=None,
clear_on_success=True,
expected_input_ids=[expected_input_id] if expected_input_id else None,
)
).outputs[0]
return await _process_result(item.result, item.data_format, self.stub, self.client)
Expand All @@ -254,7 +256,7 @@ async def run_function(self) -> Any:

while True:
try:
return await self._get_single_output(self._retry_context.input_id)
return await self._get_single_output(ctx.input_id)
except (UserCodeException, FunctionTimeoutError, LostInputsError) as exc:
await user_retry_manager.raise_or_sleep(exc)
await self._retry_input()
Expand Down

0 comments on commit 33ebf45

Please sign in to comment.