Skip to content

Commit 9fc75bc

Browse files
committed
fix linting errors
1 parent 3886afb commit 9fc75bc

File tree

5 files changed

+7
-10
lines changed
  • instrumentation
    • opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi
    • opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery
    • opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc
    • opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado
    • opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi

5 files changed

+7
-10
lines changed

Diff for: instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get(scope: dict, header_name: str) -> typing.List[str]:
4444
return [
4545
value.decode("utf8")
4646
for (key, value) in headers
47-
if key.decode("utf8") == header_name]
47+
if key.decode("utf8") == header_name
48+
]
4849

4950
@staticmethod
5051
def keys(scope: dict) -> typing.List[str]:
@@ -58,6 +59,7 @@ def keys(scope: dict) -> typing.List[str]:
5859

5960
get_header_from_scope = Getter()
6061

62+
6163
def collect_request_attributes(scope):
6264
"""Collects HTTP request attributes from the ASGI scope and returns a
6365
dictionary to be used as span creation attributes."""

Diff for: instrumentation/opentelemetry-instrumentation-celery/src/opentelemetry/instrumentation/celery/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,3 @@ def get(carrier, key):
260260
@staticmethod
261261
def keys(carrier):
262262
return carrier.keys()
263-
264-
265-

Diff for: instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_server.py

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def _check_error_code(span, servicer_context, rpc_info):
109109
if servicer_context.code != grpc.StatusCode.OK:
110110
rpc_info.error = servicer_context.code
111111

112+
112113
class Getter:
113114
@staticmethod
114115
def get(metadata, key) -> List[str]:

Diff for: instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ def _log_exception(tracer, func, handler, args, kwargs):
176176

177177
class Getter:
178178
@staticmethod
179-
def get(
180-
headers: dict, header_name: str
181-
) -> typing.List[str]:
179+
def get(headers: dict, header_name: str) -> typing.List[str]:
182180
header = headers.get(header_name)
183181
return [header] if header else []
184182

Diff for: instrumentation/opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def hello():
6868

6969
class Getter:
7070
@staticmethod
71-
def get(
72-
environ: dict, header_name: str
73-
) -> typing.List[str]:
71+
def get(environ: dict, header_name: str) -> typing.List[str]:
7472
"""Retrieve a HTTP header value from the PEP3333-conforming WSGI environ.
7573
7674
Returns:
@@ -94,6 +92,7 @@ def keys(environ: dict) -> typing.List[str]:
9492

9593
get_header_from_environ = Getter()
9694

95+
9796
def setifnotnone(dic, key, value):
9897
if value is not None:
9998
dic[key] = value

0 commit comments

Comments
 (0)