From 07d872fa0b28d80436d0378de3c2bb91c41c2f50 Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 14 May 2020 16:40:05 -0700 Subject: [PATCH] fix: new version of grpc causes linting issues if these aren't implemented (#696) This addresses the linting problems caused by a newer version of grpc: ************ Module _interceptor ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py:167:0: W0223: Method '__enter__' is abstract in class 'Channel' but is not overridden (abstract-method) ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py:167:0: W0223: Method '__exit__' is abstract in class 'Channel' but is not overridden (abstract-method) --- .../src/opentelemetry/ext/grpc/grpcext/_interceptor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py b/ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py index 0cae2cf9fde..74861913b92 100644 --- a/ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py +++ b/ext/opentelemetry-ext-grpc/src/opentelemetry/ext/grpc/grpcext/_interceptor.py @@ -230,6 +230,14 @@ def close(self): ) self._channel.close() + def __enter__(self): + """Enters the runtime context related to the channel object.""" + raise NotImplementedError() + + def __exit__(self, exc_type, exc_val, exc_tb): + """Exits the runtime context related to the channel object.""" + raise NotImplementedError() + def intercept_channel(channel, *interceptors): result = channel