Skip to content
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

[Serve] add type hints for controller and backend_worker #10288

Merged
merged 24 commits into from
Aug 27, 2020
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fac557b
Add some monkeytype type hints
architkulkarni Aug 14, 2020
1737b46
Manually clean up autogenerated type hints for api.py
architkulkarni Aug 14, 2020
c9a17fd
Added optional types
architkulkarni Aug 17, 2020
cadc974
merge from master
architkulkarni Aug 19, 2020
898db81
travis format
architkulkarni Aug 19, 2020
8d48a39
merge from master
architkulkarni Aug 19, 2020
0994641
travis format
architkulkarni Aug 19, 2020
4a07eb3
Removed binary files
architkulkarni Aug 19, 2020
f54d9ea
fix minor errors
architkulkarni Aug 19, 2020
6ec1e7e
travis format
architkulkarni Aug 19, 2020
080dab4
removed binary files again
architkulkarni Aug 19, 2020
1f0d1dd
removed last binary file
architkulkarni Aug 19, 2020
82d99d0
add type hints for controller, backend_worker
architkulkarni Aug 21, 2020
d81261b
fix type errors on running test_api
architkulkarni Aug 21, 2020
5ea3642
Merge branch 'master' into serve-type-hints-all
architkulkarni Aug 21, 2020
a3fc043
travis format
architkulkarni Aug 24, 2020
eda50b8
Merge branch 'master' into serve-type-hints-all
architkulkarni Aug 24, 2020
3b069b1
remove annotations import
architkulkarni Aug 24, 2020
cc0f07e
fix type errors
architkulkarni Aug 24, 2020
2b6e3d0
import Optional, Coroutine
architkulkarni Aug 24, 2020
720996a
revert Coroutine to Callable
architkulkarni Aug 24, 2020
2851bf4
remove type hints from RayServeWrappedWorker
architkulkarni Aug 25, 2020
d197a7b
remove optional type from api init
architkulkarni Aug 25, 2020
de01cf3
re-add type hints in api, remove from controller
architkulkarni Aug 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/ray/serve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def __call__(self, *, python_arg=None):
return f


def init(name: Optional[str] = None,
# TODO(architkulkarni): Add type hint for name after upgrading cloudpickle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine. I think cloudpickle only breaks for Optional in generated class like RayServeWrappedWorker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense. I forgot that the tests for the type hints for API were passing earlier. I'll revert this change

def init(name=None,
http_host: str = DEFAULT_HTTP_HOST,
http_port: int = DEFAULT_HTTP_PORT,
_http_middlewares: List[Any] = []) -> None:
Expand Down