Skip to content

Commit 4c9cce6

Browse files
committed
fix(confluent-kafka): Fixed some lint errors
1 parent 7a86555 commit 4c9cce6

File tree

2 files changed

+8
-11
lines changed
  • instrumentation/opentelemetry-instrumentation-confluent-kafka

2 files changed

+8
-11
lines changed

instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __init__(self, config):
137137
# This method is deliberately implemented in order to allow wrapt to wrap this function
138138
def poll(self, timeout=-1): # pylint: disable=useless-super-delegation
139139
return super().poll(timeout)
140-
140+
141141
# This method is deliberately implemented in order to allow wrapt to wrap this function
142142
def consume(self, *args, **kwargs): # pylint: disable=useless-super-delegation
143143
return super().consume(*args, **kwargs)
@@ -182,9 +182,7 @@ def committed(self, partitions, timeout=-1):
182182
def commit(self, *args, **kwargs):
183183
return self._consumer.commit(*args, **kwargs)
184184

185-
def consume(
186-
self, *args, **kwargs
187-
):
185+
def consume(self, *args, **kwargs):
188186
return ConfluentKafkaInstrumentor.wrap_consume(
189187
self._consumer.consume, self, self._tracer, args, kwargs,
190188
)
@@ -281,7 +279,7 @@ def _inner_wrap_poll(func, instance, args, kwargs):
281279
return ConfluentKafkaInstrumentor.wrap_poll(
282280
func, instance, self._tracer, args, kwargs
283281
)
284-
282+
285283
def _inner_wrap_consume(func, instance, args, kwargs):
286284
return ConfluentKafkaInstrumentor.wrap_consume(
287285
func, instance, self._tracer, args, kwargs
@@ -298,7 +296,7 @@ def _inner_wrap_consume(func, instance, args, kwargs):
298296
"poll",
299297
_inner_wrap_poll,
300298
)
301-
299+
302300
wrapt.wrap_function_wrapper(
303301
AutoInstrumentedConsumer,
304302
"consume",
@@ -373,7 +371,7 @@ def wrap_poll(func, instance, tracer, args, kwargs):
373371
)
374372

375373
return record
376-
374+
377375
@staticmethod
378376
def wrap_consume(func, instance, tracer, args, kwargs):
379377
if instance._current_consume_span:
@@ -399,7 +397,7 @@ def wrap_consume(func, instance, tracer, args, kwargs):
399397
records[0].topic(),
400398
operation=MessagingOperationValues.PROCESS,
401399
)
402-
400+
403401
instance._current_context_token = context.attach(
404402
trace.set_span_in_context(instance._current_consume_span)
405403
)

instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/utils.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ def __init__(self, queue, config):
77
self._queue = queue
88
super().__init__(config)
99

10-
def consume(self, num_messages=1, *args, **kwargs):
10+
def consume(self, num_messages=1, *args, **kwargs): # pylint: disable=keyword-arg-before-vararg
1111
messages = self._queue[:num_messages]
1212
self._queue = self._queue[num_messages:]
1313
return messages
1414

1515
def poll(self, timeout=None):
1616
if len(self._queue) > 0:
1717
return self._queue.pop(0)
18-
else:
19-
return None
18+
return None
2019

2120

2221
class MockedMessage:

0 commit comments

Comments
 (0)