[Docs] Fix async code in serving notebook#53864
Merged
angelinalg merged 11 commits intomasterfrom Jun 19, 2025
Merged
Conversation
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates async execution in Jupyter notebooks by adding a wait flag for notebook conversion and converting the serving test into proper async functions with error handling.
- Added
--waitflag to ensure the notebook conversion completes before execution. - Changed
test_serveto anasync def, addedresponse.raise_for_status(), and updated invocation to useawait. - Adjusted
fetch_all_concurrentlyusage to return predictions and print a completion message.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| doc/source/ray-overview/examples/e2e-xgboost/notebooks/01-Distributed_Training.ipynb | Added --wait flag to the Ray CLI invocation for notebook scripts |
| doc/source/ray-overview/examples/e2e-timeseries/e2e_timeseries/03-Serving.ipynb | Updated serving test to async, improved HTTP error handling, and updated invocation |
Comments suppressed due to low confidence (2)
doc/source/ray-overview/examples/e2e-timeseries/e2e_timeseries/03-Serving.ipynb:302
- [nitpick] Since return_exceptions=True prevents errors from propagating, consider setting it to False or explicitly handling exceptions in the returned responses list to avoid silent failures.
responses = await asyncio.gather(*tasks, return_exceptions=True)
doc/source/ray-overview/examples/e2e-xgboost/notebooks/01-Distributed_Training.ipynb:890
- [nitpick] Consider adding a comment explaining why the
--waitflag is necessary for notebook conversions to complete before execution, improving clarity for readers.
--wait \\
doc/source/ray-overview/examples/e2e-timeseries/e2e_timeseries/03-Serving.ipynb
Outdated
Show resolved
Hide resolved
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
166048d to
ce6d594
Compare
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
Signed-off-by: Ricardo Decal <rdecal@anyscale.com>
minerharry
pushed a commit
to minerharry/ray
that referenced
this pull request
Jun 27, 2025
elliot-barn
pushed a commit
that referenced
this pull request
Jul 2, 2025
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.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.
Why are these changes needed?
Async code works in scripts/CI but not on jupyter notebooks on Workspaces.
Related issue number
N/A
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.