Skip to content

Commit

Permalink
[core][streaming][python] Fix asyncio.wait coroutines args deprecated…
Browse files Browse the repository at this point in the history
… warnings ray-project#40292

Passing coroutines directly to asyncio.wait is deprecating (warnings in >3.8, and deprecated >3.10)

We should not be doing it.
  • Loading branch information
rickyyx authored and jonathan-anyscale committed Oct 26, 2023
1 parent 0f19f4c commit e5baf74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/ray/_raylet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ class StreamingObjectRefGenerator:
ref = core_worker.peek_object_ref_stream(
self._generator_ref)
# TODO(swang): Avoid fetching the value.
ready, unready = await asyncio.wait([self.suppress_exceptions(ref)],
timeout=timeout_s)
ready, unready = await asyncio.wait(
[asyncio.create_task(self.suppress_exceptions(ref))],
timeout=timeout_s
)
if len(unready) > 0:
return ObjectRef.nil()

Expand Down

0 comments on commit e5baf74

Please sign in to comment.