From 6983a254d6cf7bfe73df8ab1f6fedfde73b5da04 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 93c59b54c51..e26d4c98149 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 @@ -231,6 +231,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