[tune][train] Improve ray.train method deprecations called from Tune functions#57810
Merged
justinvyu merged 2 commits intoray-project:masterfrom Oct 17, 2025
Merged
Conversation
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request improves the deprecation warnings for ray.train APIs when used within Ray Tune, which is a great enhancement for user experience. The implementation correctly raises DeprecationWarning and the accompanying tests cover both the new and old behavior. My review includes a couple of suggestions to improve code maintainability by reducing duplication in both the implementation and the tests. Overall, the changes are solid.
xinyuangui2
approved these changes
Oct 16, 2025
justinyeh1995
pushed a commit
to justinyeh1995/ray
that referenced
this pull request
Oct 20, 2025
…e functions (ray-project#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com>
xinyuangui2
pushed a commit
to xinyuangui2/ray
that referenced
this pull request
Oct 22, 2025
…e functions (ray-project#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: xgui <xgui@anyscale.com>
elliot-barn
pushed a commit
that referenced
this pull request
Oct 23, 2025
…e functions (#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
landscapepainter
pushed a commit
to landscapepainter/ray
that referenced
this pull request
Nov 17, 2025
…e functions (ray-project#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com>
Aydin-ab
pushed a commit
to Aydin-ab/ray-aydin
that referenced
this pull request
Nov 19, 2025
…e functions (ray-project#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
Future-Outlier
pushed a commit
to Future-Outlier/ray
that referenced
this pull request
Dec 7, 2025
…e functions (ray-project#57810) Ray Tune users need to stop using `ray.train.get_context()`, `ray.train.get_checkpoint()` and `ray.train.report`. This PR improves the error messages raise if they try to call these instead of the `ray.tune` counterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months. --------- Signed-off-by: Justin Yu <justinvyu@anyscale.com> Signed-off-by: Future-Outlier <eric901201@gmail.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.
Description
Ray Tune users need to stop using
ray.train.get_context(),ray.train.get_checkpoint()andray.train.report. This PR improves the error messages raise if they try to call these instead of theray.tunecounterparts. Note that we've already soft-deprecated this usage with a warning message for 6+ months.Related issues
#49454
Additional information
Before:
After: