-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Correct asyncio ref documentation for Python 3.11+ #54157
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
base: master
Are you sure you want to change the base?
Correct asyncio ref documentation for Python 3.11+ #54157
Conversation
Signed-off-by: David Wagner <david@wagnerkc.com>
62219b9
to
413d98a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the async actor docs to explicitly call out asyncio patterns supported in different Python versions and moves the external asyncio
link below the examples.
- Clarify how to wait on an
ObjectRef
in Python 3.9 and 3.10 - Show direct
Future
object usage in Python 3.11+ - Relocate the reference to the official asyncio docs after both examples
Comments suppressed due to low confidence (2)
doc/source/ray-core/actors/async_api.rst:107
- [nitpick] Consider renaming this heading to 'Wait on ObjectRef (Python 3.9 & 3.10):' for clarity, consistent casing, and to match the style of other subheadings.
you can wait on the ref (Python 3.9 and Python 3.10):
doc/source/ray-core/actors/async_api.rst:124
- [nitpick] To keep a parallel imperative style, you might use 'Access the Future object directly (Python 3.11+):' instead of starting with 'or'.
or the Future object directly (Python 3.11+):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for maintaining the docs!
Co-authored-by: angelinalg <122562471+angelinalg@users.noreply.github.com> Signed-off-by: David Wagner <david@wagnerkc.com>
Co-authored-by: angelinalg <122562471+angelinalg@users.noreply.github.com> Signed-off-by: David Wagner <david@wagnerkc.com>
Signed-off-by: David Wagner <david@wagnerkc.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty!! this is a broken window that probably should've been fixed a long time ago cc @edoakes for merge
Why are these changes needed?
Python 3.11+ issue identified in #31606 (comment), but not explicitly called out in docs leading to failure running this example: https://docs.ray.io/en/latest/ray-core/actors/async_api.html#objectrefs-as-asyncio-futures
Will come back to get all checks in place, figure out build locally, but will get some eyes on this change first.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.