Repository navigation
[ci/doc] Stop failing documented @Deprecated APIs in the API-doc check - #66612
Merged
Merged
Conversation
The API policy (doc/source/ray-contribute/api-policy.md) requires deprecated APIs to be documented, but the docs-side consistency check failed any documented name that resolved to a @deprecated object. Keep the private-name rule and drop the deprecated leg, remove the now-unused live-annotation introspection, and drop the four Ray Data exemptions that existed only to work around the rule. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman
marked this pull request as ready for review
September 30, 2026 19:13
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the API discrepancy check tool to align with the API policy, which requires @deprecated APIs to be documented. Consequently, the introspect_annotation_type method has been removed, and the validation logic in split_resolvable_and_broken_doc_apis has been simplified to only flag private-named APIs rather than deprecated ones. Related tests and configuration debt lists have been updated accordingly. There are no review comments to address, and I have no additional feedback to provide.
elliot-barn
approved these changes
Sep 30, 2026
dstrodtman
enabled auto-merge (squash)
September 30, 2026 19:27
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
ray-project#66612) ## Why The [API policy](https://docs.ray.io/en/latest/ray-contribute/api-policy.html) says deprecated APIs must be documented. The docs-side half of `doc: check API doc consistency`, added in ray-project#64420, did the opposite: it failed any documented autosummary or autoclass entry that resolved to a `@Deprecated` object. That's what blocked ray-project#66308, which deprecates `read_clickhouse` and `write_clickhouse` and leaves them documented with a deprecation notice, which is what the policy asks for. Teams have been working around the rule instead. Ray Data kept its deprecated APIs in `tracked_doc_debt` under a comment asking for them to be removed from the docs. ## What - `API.split_resolvable_and_broken_doc_apis` no longer flags deprecated objects. It still fails documented names that don't resolve and documented names that resolve to private objects (`_foo` or `._internal.`), with the existing override-hook and `__all__` re-export exemptions unchanged. - It returns `(unresolved, private)` instead of `(unresolved, non_public)`, and the error output says "private" instead of "deprecated / private." - `API.introspect_annotation_type` is removed. The deprecated check was its only caller. The inherited-annotation behavior it tested is still covered through `Module` in `test_module.py`. - The four Ray Data `tracked_doc_debt` entries for deprecated APIs are removed: `AggregateFn`, `Dataset.iter_tf_batches`, `Dataset.to_random_access_dataset`, and `read_unity_catalog`. All four are `@Deprecated` in source, so the entries only existed to get around this rule. Out of scope: the policy also implies the code-side check should *require* deprecated APIs to be documented. Today that check skips them. There are about 90 `@Deprecated` decorators under `python/ray`, many on undocumented methods, so turning that on is a per-team burndown and belongs in a follow-up. ## Duplicate check No open PR touches this rule. I searched open PRs for `api_policy_check`, `cmd_check_api_discrepancy`, and "API doc consistency" together with deprecation. ray-project#66308 is the PR this unblocks, not a duplicate. ## Testing ``` python -m pytest ci/ray_ci/doc/test_api.py ci/ray_ci/doc/test_cmd_check_api_discrepancy.py ci/ray_ci/doc/test_module.py 40 passed pre-commit run --files <changed files> # ruff, black, docstyle, import order: all passed ``` I didn't run the checker end to end against a real Ray install. This PR's `doc: check API doc consistency` step does that, and should pass with the four Data exemptions removed. This PR was written with AI assistance (Claude Code). I reviewed the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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
The API policy says deprecated APIs must be documented. The docs-side half of
doc: check API doc consistency, added in #64420, did the opposite: it failed any documented autosummary or autoclass entry that resolved to a@Deprecatedobject. That's what blocked #66308, which deprecatesread_clickhouseandwrite_clickhouseand leaves them documented with a deprecation notice, which is what the policy asks for.Teams have been working around the rule instead. Ray Data kept its deprecated APIs in
tracked_doc_debtunder a comment asking for them to be removed from the docs.What
API.split_resolvable_and_broken_doc_apisno longer flags deprecated objects. It still fails documented names that don't resolve and documented names that resolve to private objects (_fooor._internal.), with the existing override-hook and__all__re-export exemptions unchanged.(unresolved, private)instead of(unresolved, non_public), and the error output says "private" instead of "deprecated / private."API.introspect_annotation_typeis removed. The deprecated check was its only caller. The inherited-annotation behavior it tested is still covered throughModuleintest_module.py.tracked_doc_debtentries for deprecated APIs are removed:AggregateFn,Dataset.iter_tf_batches,Dataset.to_random_access_dataset, andread_unity_catalog. All four are@Deprecatedin source, so the entries only existed to get around this rule.Out of scope: the policy also implies the code-side check should require deprecated APIs to be documented. Today that check skips them. There are about 90
@Deprecateddecorators underpython/ray, many on undocumented methods, so turning that on is a per-team burndown and belongs in a follow-up.Duplicate check
No open PR touches this rule. I searched open PRs for
api_policy_check,cmd_check_api_discrepancy, and "API doc consistency" together with deprecation. #66308 is the PR this unblocks, not a duplicate.Testing
I didn't run the checker end to end against a real Ray install. This PR's
doc: check API doc consistencystep does that, and should pass with the four Data exemptions removed.This PR was written with AI assistance (Claude Code). I reviewed the change.
🤖 Generated with Claude Code