Skip to content

Commit bbbb7aa

Browse files
committed
fix linting issues
1 parent fb47e31 commit bbbb7aa

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

opentelemetry-api/src/opentelemetry/util/_importlib_metadata.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414

1515
# FIXME: Use importlib.metadata when support for 3.11 is dropped if the rest of
1616
# the supported versions at that time have the same API.
17-
from importlib_metadata import (
18-
EntryPoint,
19-
EntryPoints,
20-
entry_points,
21-
version,
22-
)
17+
from importlib_metadata import EntryPoint, EntryPoints, entry_points, version
2318

2419
# The importlib-metadata library has introduced breaking changes before to its
2520
# API, this module is kept just to act as a layer between the

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
from json import dumps
6565
from os import environ
6666
from types import ModuleType
67-
from typing import List, MutableMapping, Optional, Sequence, Union, cast
67+
from typing import List, MutableMapping, Optional, cast
6868
from urllib import parse
6969

7070
from opentelemetry.attributes import BoundedAttributes
@@ -211,9 +211,10 @@ def create(
211211

212212
if not resource.attributes.get(SERVICE_NAME, None):
213213
default_service_name = "unknown_service"
214-
process_executable_name = cast(Optional[str], resource.attributes.get(
215-
PROCESS_EXECUTABLE_NAME, None
216-
))
214+
process_executable_name = cast(
215+
Optional[str],
216+
resource.attributes.get(PROCESS_EXECUTABLE_NAME, None),
217+
)
217218
if process_executable_name:
218219
default_service_name += ":" + process_executable_name
219220
resource = resource.merge(
@@ -266,7 +267,7 @@ def merge(self, other: "Resource") -> "Resource":
266267
other.schema_url,
267268
)
268269
return self
269-
return Resource(merged_attributes, schema_url) # type: ignore
270+
return Resource(merged_attributes, schema_url) # type: ignore
270271

271272
def __eq__(self, other: object) -> bool:
272273
if not isinstance(other, Resource):
@@ -278,11 +279,13 @@ def __eq__(self, other: object) -> bool:
278279

279280
def __hash__(self) -> int:
280281
return hash(
281-
f"{dumps(self._attributes.copy(), sort_keys=True)}|{self._schema_url}" # type: ignore
282+
f"{dumps(self._attributes.copy(), sort_keys=True)}|{self._schema_url}" # type: ignore
282283
)
283284

284285
def to_json(self, indent: int = 4) -> str:
285-
attributes: MutableMapping[str, AttributeValue] = dict(self._attributes)
286+
attributes: MutableMapping[str, AttributeValue] = dict(
287+
self._attributes
288+
)
286289
return dumps(
287290
{
288291
"attributes": attributes, # type: ignore

0 commit comments

Comments
 (0)