-
Notifications
You must be signed in to change notification settings - Fork 7k
[core] Fixes static type hints for ActorClass when setting options through ray.remote #58439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Fixes static type hints for ActorClass when setting options through ray.remote #58439
Conversation
787887b to
6d2c5aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses the issue of incorrect static type hints for ActorClass when using ray.remote. The added overloads in python/ray/_private/worker.py correctly type hint ray.remote(Actor) and ray.remote(**options)(Actor) to return a generic ActorClass[T], which is a great improvement for static analysis. The reordering of @overload decorators for ray.method in python/ray/actor.py also appears to be a good change to handle methods with default arguments more robustly. The changes are clean and well-targeted. One minor point is that a comment in python/ray/_private/worker.py (lines 3465-3466 on the right side of the diff) is now outdated due to the typing improvements in this PR, and could be removed to avoid confusion.
Signed-off-by: will.lin <will.lin@anyscale.com>
Signed-off-by: will.lin <will.lin@anyscale.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com>
…rough ray.remote (ray-project#58439) Fixes static type hints for ActorClass when setting options through ray.remote Closes ray-project#58401 and ray-project#58402 cc @richardliaw @edoakes @pcmoritz --------- Signed-off-by: will.lin <will.lin@anyscale.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
Description
Fixes static type hints for ActorClass when setting options through ray.remote

Currently:
After this PR:

Related issues
Closes #58401 and #58402
cc @richardliaw @edoakes @pcmoritz
Additional information