Skip to content

refactor(miles): inline await in _ray_get, drop _await_ref helper#26

Open
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/miles-mvp-e2efrom
TianyeGGBond:tianye/m11-drop-await-ref
Open

refactor(miles): inline await in _ray_get, drop _await_ref helper#26
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/miles-mvp-e2efrom
TianyeGGBond:tianye/m11-drop-await-ref

Conversation

@TianyeGGBond

Copy link
Copy Markdown
Collaborator

Context

_ray_get delegated each await to a one-line _await_ref(ref) helper whose
body was just return await ref. The helper also carried a function-local
import asyncio # noqa: F401 that it never used and that is already imported
at the module top — misleading dead code.

Ray ObjectRefs are awaitable, so _ray_get can await them directly.

Change

pipeline/miles_model_update_service.py:

  • List form: await asyncio.gather(*refs) (was gather(*[_await_ref(r) ...])).
  • Single form: await refs (was await _await_ref(refs)).
  • Delete the _await_ref helper and its unused local import.

No behavior change; +2 / -8 lines.

_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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant