Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serve] Add to_object_ref methods to ReplicaResult #48544

Merged
merged 7 commits into from
Nov 4, 2024

Conversation

edoakes
Copy link
Contributor

@edoakes edoakes commented Nov 4, 2024

Why are these changes needed?

Formalizes the interface for these methods since non-actor ReplicaResult implementations like LocalReplicaResult won't implement them and need to explicitly raise a good error message when they occur.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Edward Oakes <[email protected]>
@edoakes edoakes requested a review from zcin November 4, 2024 15:44
Signed-off-by: Edward Oakes <[email protected]>
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Nov 4, 2024
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
python/ray/serve/_private/replica_result.py Outdated Show resolved Hide resolved

@_process_response
async def get_async(self):
assert (
self._obj_ref is not None or not self._is_streaming
), "get_async() can only be called on a non-streaming ActorReplicaResult"
not self._is_streaming
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these assertion statements if they are all going to be caught in to_object_ref and to_object_ref_async?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not, but being explicit doesn't hurt

edoakes and others added 2 commits November 4, 2024 13:31
Co-authored-by: Cindy Zhang <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
@edoakes edoakes enabled auto-merge (squash) November 4, 2024 19:33
@edoakes edoakes merged commit 1eeb896 into ray-project:master Nov 4, 2024
6 checks passed
Jay-ju pushed a commit to Jay-ju/ray that referenced this pull request Nov 5, 2024
…8544)

Formalizes the interface for these methods since non-actor
`ReplicaResult` implementations like `LocalReplicaResult` won't
implement them and need to explicitly raise a good error message when
they occur.

---------

Signed-off-by: Edward Oakes <[email protected]>
Co-authored-by: Cindy Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants