Repository navigation
[data][llm] Convert ray.data.llm docstring examples to render-only doctests - #67208
Merged
Merged
Conversation
…ctests Convert the seven `:skipif: True` testcode blocks in the processor config classes and build_processor to `>>>` doctests. Each docstring carries one `# doctest: +SKIP_EXAMPLE` flag, which skips it whole: the examples need GPUs, model downloads, an OpenAI key, or a Serve deployment, so they stay render-only as before. @rtd-build Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request converts Sphinx-style testcode blocks to standard Python doctest blocks with skip annotations in python/ray/data/llm.py. The review feedback points out that two of the example blocks in build_processor are missing the # doctest: +SKIP_EXAMPLE annotation on their first lines, which is necessary to ensure they are consistently skipped by doctest runners.
kouroshHakha
approved these changes
Oct 20, 2026
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.
Description
Converts the seven
.. testcode::examples inpython/ray/data/llm.pyto>>>doctests. They're inHttpRequestProcessorConfig,vLLMEngineProcessorConfig,SGLangEngineProcessorConfig,ServeDeploymentProcessorConfig, andbuild_processor, which holds three of them. The change touches only docstrings.The examples stay render-only. Every block was
:skipif: True, because running them needs GPUs and model downloads, an OpenAI API key, or a running Serve deployment. Each docstring now carries one# doctest: +SKIP_EXAMPLEflag on its first line, which skips the whole docstring in both the//python/ray/data:doctesttarget and thedocstring-onlyexamples step. Sphinx strips the flag from the rendered page. The code itself is unchanged apart from the>>>and...prompts and the removal of the blank lines a doctest can't contain.This is separate from the other Ray Data docstring conversions, such as #67202 and #67207, because CODEOWNERS assigns
python/ray/data/llm.pyto@ray-project/ray-llm.Related issues
Related to #67080, #67202, and #67207.
Additional information
Not a duplicate. I searched open PRs that mention
llm.pyor convertingray.data.llmdocstring examples. None touches these examples.Tests run
ci/ray_ci/doc/check_docstring_only.py --base upstream/master: "1 file(s), docstrings only."ci/ray_ci/doc/run_docstring_examples.py python/ray/data/llm.pyagainst the macOS arm64 Ray nightly at43b706d733c, whosellm.pymatches this PR's base, with the converted file swapped in: 0 run, 0 failed, 5 skipped for+SKIP_EXAMPLE.pytest --doctest-modules -p doctest_pytest_pluginon the same file, with the Ray Data doctest plugin: 5 skipped as "render-only example (+SKIP_EXAMPLE)", no collection errors.doctest.DocTestParserand compiles.pre-commiton commit: all hooks pass, including black, ruff, and the Ray docstyle check.The PR carries the
docstring-onlylabel, and its commit carries an@rtd-buildline for the Read the Docs preview.AI assistance (Claude Code) was used for this PR.
🤖 Generated with Claude Code