Skip to content

[Docs] Fix async code in serving notebook - #53864

Merged
angelinalg merged 11 commits into
masterfrom
docs/minor-improvements
Jun 19, 2025
Merged

angelinalg merged 11 commits into
masterfrom
docs/minor-improvements

Conversation

@crypdick

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Async code works in scripts/CI but not on jupyter notebooks on Workspaces.

Related issue number

N/A

Checks

Copilot AI review requested due to automatic review settings June 16, 2025 22:16
@crypdick
crypdick requested a review from a team as a code owner June 16, 2025 22:16
@crypdick crypdick added docs An issue or change related to documentation go add ONLY when ready to merge, run all tests labels Jun 16, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 --wait flag to ensure the notebook conversion completes before execution.
  • Changed test_serve to an async def, added response.raise_for_status(), and updated invocation to use await.
  • Adjusted fetch_all_concurrently usage 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 --wait flag is necessary for notebook conversions to complete before execution, improving clarity for readers.
--wait \\

@angelinalg angelinalg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

stamp

@crypdick
crypdick force-pushed the docs/minor-improvements branch from 166048d to ce6d594 Compare June 17, 2025 23:42
@angelinalg
angelinalg merged commit 2be023b into master Jun 19, 2025
@angelinalg
angelinalg deleted the docs/minor-improvements branch June 19, 2025 22:38
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants