refactor(miles): inline await in _ray_get, drop _await_ref helper#26
Open
TianyeGGBond wants to merge 1 commit into
Open
refactor(miles): inline await in _ray_get, drop _await_ref helper#26TianyeGGBond wants to merge 1 commit into
TianyeGGBond wants to merge 1 commit into
Conversation
_await_ref(ref) was just `return await ref` wrapped behind a redundant function-local `import asyncio` (the module already imports asyncio, and the helper did not use it). Ray ObjectRefs are awaitable, so _ray_get can await them directly and gather the list form without the indirection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
_ray_getdelegated each await to a one-line_await_ref(ref)helper whosebody was just
return await ref. The helper also carried a function-localimport asyncio # noqa: F401that it never used and that is already importedat the module top — misleading dead code.
Ray
ObjectRefs are awaitable, so_ray_getcan await them directly.Change
pipeline/miles_model_update_service.py:await asyncio.gather(*refs)(wasgather(*[_await_ref(r) ...])).await refs(wasawait _await_ref(refs))._await_refhelper and its unused local import.No behavior change; +2 / -8 lines.