Repository navigation
[Train] Fix all of Train's pydoclint issues - #63365
Merged
matthewdeng merged 3 commits intoMay 18, 2026
Merged
Conversation
Signed-off-by: Mark Towers <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request focuses on resolving a large number of pydoclint violations across the ray.train module by standardizing docstrings and type hints. Key improvements include adding missing Args, Returns, and Yields sections, reordering docstring parameters to match function signatures, and refining type annotations for clarity. A review comment correctly identifies a discrepancy in BackendExecutor._create_rank_world_size_mappings, where the docstring describes the return value as a tuple while the implementation and type hint specify a list.
added 2 commits
May 15, 2026 12:38
Signed-off-by: Mark Towers <[email protected]>
TruongQuangPhat
pushed a commit
to cyhapun/ray-fix-issue
that referenced
this pull request
May 27, 2026
## Description ray-project#52974 added pydoclint to pre-commit without fixing any issues through adding all the problematic docstrings to an ignore list. However this means that all the docstrings that do have issues / problems with them that aren't raised or fixed. This PR removes all of Train's ignores then uses Claude to fix all the docstrings / type hints (and reviewed by me to confirm implementations). --------- Signed-off-by: Mark Towers <[email protected]> Co-authored-by: Mark Towers <[email protected]> Signed-off-by: phattruong <[email protected]>
alexandrplashchinsky
pushed a commit
to alexandrplashchinsky/ray-alex
that referenced
this pull request
May 29, 2026
## Description ray-project#52974 added pydoclint to pre-commit without fixing any issues through adding all the problematic docstrings to an ignore list. However this means that all the docstrings that do have issues / problems with them that aren't raised or fixed. This PR removes all of Train's ignores then uses Claude to fix all the docstrings / type hints (and reviewed by me to confirm implementations). --------- Signed-off-by: Mark Towers <[email protected]> Co-authored-by: Mark Towers <[email protected]> Signed-off-by: Alexandr Plashchinsky <[email protected]>
400Ping
pushed a commit
to 400Ping/ray
that referenced
this pull request
Aug 18, 2026
## Description ray-project#52974 added pydoclint to pre-commit without fixing any issues through adding all the problematic docstrings to an ignore list. However this means that all the docstrings that do have issues / problems with them that aren't raised or fixed. This PR removes all of Train's ignores then uses Claude to fix all the docstrings / type hints (and reviewed by me to confirm implementations). --------- Signed-off-by: Mark Towers <[email protected]> Co-authored-by: Mark Towers <[email protected]> Signed-off-by: 400Ping <[email protected]>
Closed
4 of 8 tasks
5 of 7 tasks
pseudo-rnd-thoughts
pushed a commit
that referenced
this pull request
Nov 16, 2026
…n legacy LightGBM/XGBoost trainers (#68145) ## Why are these changes needed? In `_get_legacy_train_fn_per_worker` for both `LightGBMTrainer` (`python/ray/train/lightgbm/lightgbm_trainer.py`) and `XGBoostTrainer` (`python/ray/train/xgboost/xgboost_trainer.py`): 1. `num_boost_round = num_boost_round or DEFAULT_NUM_BOOST_ROUND` used truthiness instead of an explicit `is None` check. When a caller explicitly passed `num_boost_round=0` (for example in dry-run initialization or checkpoint evaluation without additional boosting rounds), `0 or 10` silently evaluated to `10`. 2. `callbacks = trainer_kwargs.get("callbacks", [])` retrieved the caller's list reference directly and appended `default_callback_cls()` in-place (`callbacks.append(...)`). Reusing the same configuration dictionary across multiple `Trainer` instantiations mutated the caller's `callbacks` list on each run, and passing `callbacks=None` or a tuple raised an `AttributeError`. This PR: - Checks `if num_boost_round is None: num_boost_round = DEFAULT_NUM_BOOST_ROUND` so explicit `0` is preserved. - Copies `callbacks = list(trainer_kwargs.get("callbacks") or [])` before appending the default `RayTrainReportCallback`. ## Related issue number N/A ## Checks - [x] I've signed off every commit(by using the -s flag, i.e., `git commit -s`) in this PR. - [x] I've run `scripts/format.sh` to lint the changes in this PR. - [x] I've included any doc changes needed for https://docs.ray.io/en/master/. - [x] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/ - Testing Strategy - [x] Unit tests (`python/ray/train/tests/test_lightgbm_trainer.py` and `python/ray/train/tests/test_xgboost_trainer.py`) - [ ] Release tests - [ ] This PR is not tested :( ## Acknowledgements Thanks to @dstrodtman (#67821, #67786, #67620), @pseudo-rnd-thoughts (#63988, #63427, #63365), and @justinvyu (#57256, #50042) for their work maintaining `LightGBMTrainer` and `XGBoostTrainer`. --------- Signed-off-by: Parth Vadera <[email protected]> Co-authored-by: Copilot <[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.

Description
#52974 added pydoclint to pre-commit without fixing any issues through adding all the problematic docstrings to an ignore list.
However this means that all the docstrings that do have issues / problems with them that aren't raised or fixed.
This PR removes all of Train's ignores then uses Claude to fix all the docstrings / type hints (and reviewed by me to confirm implementations).