-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Add grpcio-status extension package #17490
Conversation
|
|
|
|
* The new package has 2 API `from_call` and `to_status` * Utilize the experimental API `abort_with_status` * Add 5 unit test cases
c8b2f0c
to
45b3230
Compare
|
|
|
|
# Install testing | ||
pip_install_dir "$ROOT/src/python/grpcio_testing" | ||
|
||
# Build/install tests | ||
$VENV_PYTHON -m pip install coverage==4.4 oauth2client==4.1.0 \ | ||
google-auth==1.0.0 requests==2.14.2 | ||
google-auth==1.0.0 requests==2.14.2 \ |
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.
Is there a reason we're pinning to specific versions of these libraries?
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.
Thanks for reviewing. I don't have the context about these libraries' version. But the build_python.sh
is only used in testing environment. Pin the packages to a working version can protect us from flakiness/failures introduced by other packages' update.
|
|
|
|
|
|
|
3d97b11
to
b9cb245
Compare
|
|
|
1 similar comment
|
|
|
|
1 similar comment
|
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.
A couple suggestions for the docstrings on the new API, otherwise LGTM
Should the APIs in the new package be explicitly marked as experimental, or is this already implied by some other part of our distribution process?
@ericgribkoff Thanks for reviewing. I have adopted your advice and updated the docstring:
|
Args: | ||
call: A grpc.Call instance. | ||
|
||
Returns: | ||
A google.rpc.status.Status message representing the status of the RPC. | ||
|
||
Raises: | ||
ValueError: If the status code, status message is inconsistent with the rich status | ||
inside of the google.rpc.status.Status. | ||
ValueError: If the gRPC call's code or details are inconsistent with the status code and message inside of the google.rpc.status.Status. |
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.
Line length?
|
|
* Mark API as experimental * Rephrase the raise condition * Add more detail to the returned object
9ad3d4a
to
40b8ca9
Compare
|
|
|
|
This PR implements the extension package of grpc/proposal#118 |
|
|
|
|
|
|
from_call
andto_status
abort_with_status