Skip to content

Commit

Permalink
Fix return type of workflow.wait
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jan 17, 2025
1 parent 1a68b58 commit ceccf76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions temporalio/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4692,7 +4692,7 @@ async def wait(
*,
timeout: Optional[float] = None,
return_when: str = asyncio.ALL_COMPLETED,
) -> Tuple[List[asyncio.Task[AnyType]], set[asyncio.Task[AnyType]]]: ...
) -> Tuple[List[asyncio.Task[AnyType]], List[asyncio.Task[AnyType]]]: ...


async def wait(
Expand All @@ -4711,9 +4711,9 @@ async def wait(
# but the "set" is changed out for a "list" and fixed up some typing/format

if asyncio.isfuture(fs) or asyncio.iscoroutine(fs):
raise TypeError(f"expect a list of futures, not {type(fs).__name__}")
raise TypeError(f"Expect an iterable of Tasks/Futures, not {type(fs).__name__}")
if not fs:
raise ValueError("Set of Tasks/Futures is empty.")
raise ValueError("Sequence of Tasks/Futures must not be empty.")
if return_when not in (
asyncio.FIRST_COMPLETED,
asyncio.FIRST_EXCEPTION,
Expand All @@ -4740,7 +4740,7 @@ async def _wait(
# https://github.com/python/cpython/blob/v3.12.3/Lib/asyncio/tasks.py#L522
# but the "set" is changed out for a "list" and fixed up some typing/format

assert fs, "Set of Futures is empty."
assert fs, "Sequence of Tasks/Futures must not be empty."
waiter = loop.create_future()
timeout_handle = None
if timeout is not None:
Expand Down

0 comments on commit ceccf76

Please sign in to comment.