-
Notifications
You must be signed in to change notification settings - Fork 599
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
Keep client interceptors in sync with grpc client interceptors #442
Conversation
|
759b52b
to
d427742
Compare
Can someone review this PR? |
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.
I wonder if we should use **kwargs instead?
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 the fix @mihirg! Please remove these comments from instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/grpcext/_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/grpcext/_interceptor.py
# pylint:disable=arguments-differ
# pylint:disable=signature-differs
Removing them should alert us of any further discrepancies between our implementation and the base classes 👍
8b4e15c
to
fb82ebd
Compare
@ocelotl Done. |
instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py
Show resolved
Hide resolved
@@ -41,41 +39,67 @@ class _StreamClientInfo( | |||
): | |||
pass | |||
|
|||
def _get_metadata_timeout(**kwargs): |
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.
This is being called as _get_metadata_timeout(kwargs)
which would raise _get_metadata_timeout() takes 0 positional arguments but 1 was given
.
def _get_metadata_timeout(**kwargs): | |
def _get_metadata_timeout(kwargs): |
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.
Unless it is fine to return None
as the value for metadata
and/or timeout
, then this should not use **kwargs
. This looks like we should be using positional arguments as before instead of using **kwargs
.
...elemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/grpcext/_interceptor.py
Outdated
Show resolved
Hide resolved
@@ -41,41 +39,67 @@ class _StreamClientInfo( | |||
): | |||
pass | |||
|
|||
def _get_metadata_timeout(**kwargs): |
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.
Unless it is fine to return None
as the value for metadata
and/or timeout
, then this should not use **kwargs
. This looks like we should be using positional arguments as before instead of using **kwargs
.
...elemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/grpcext/_interceptor.py
Outdated
Show resolved
Hide resolved
fb82ebd
to
7a3cb42
Compare
5ee4658
to
d840347
Compare
d840347
to
6a23095
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.
Thanks @mihirg! Great first contribution 💪 😎
@mihirg apparently there are a few lint issues. No worries, the best way of getting them fixed is by doing this:
If it passes, then you are good to commit the fixes and push your branch again. If there are failures, they should be |
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 the contribution!
6a23095
to
b8fc7b2
Compare
@ocelotl I have fixed the the linter issues. |
Description
Keep the opentelemetry interceptors in sync with grpc interceptors
Fixes # (issue)
#320
The discussion on this issue states a more serious refactoring is needed. This fix is to get people unblocked.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Yes. Updated test cases
Does This PR Require a Core Repo Change?
Checklist: