Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asasvari authored and attila-s committed Jul 22, 2024
1 parent 16beda2 commit 127464b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions opentelemetry-api/src/opentelemetry/context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _load_runtime_context() -> _RuntimeContext:
try:
return next( # type: ignore
iter( # type: ignore
entry_points( # type: ignore
entry_points(
group="opentelemetry_context",
name=configured_context,
)
Expand All @@ -58,7 +58,7 @@ def _load_runtime_context() -> _RuntimeContext:
)
return next( # type: ignore
iter( # type: ignore
entry_points( # type: ignore
entry_points(
group="opentelemetry_context",
name=default_context,
)
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/opentelemetry/propagate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def inject(
propagators.append( # type: ignore
next( # type: ignore
iter( # type: ignore
entry_points( # type: ignore
entry_points(
group="opentelemetry_propagator",
name=propagator,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# FIXME: Use importlib.metadata when support for 3.11 is dropped if the rest of
# the supported versions at that time have the same API.
from importlib_metadata import ( # type: ignore
from importlib_metadata import (
EntryPoint,
EntryPoints,
entry_points,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-api/src/opentelemetry/util/_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _load_provider(
Provider,
next( # type: ignore
iter( # type: ignore
entry_points( # type: ignore
entry_points(
group=f"opentelemetry_{provider}",
name=provider_name,
)
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
from json import dumps
from os import environ
from types import ModuleType
from typing import List, Optional, Sequence, Union
from typing import List, Optional, Sequence, Union, cast
from urllib import parse

from opentelemetry.attributes import BoundedAttributes
Expand Down Expand Up @@ -211,11 +211,11 @@ def create(

if not resource.attributes.get(SERVICE_NAME, None):
default_service_name = "unknown_service"
process_executable_name: Optional[Union[int, float, Sequence[str], Sequence[int], Sequence[float] ]] = resource.attributes.get(
process_executable_name = cast(Optional[str], resource.attributes.get(
PROCESS_EXECUTABLE_NAME, None
)
))
if process_executable_name:
default_service_name += ":" + str(process_executable_name)
default_service_name += ":" + process_executable_name
resource = resource.merge(
Resource({SERVICE_NAME: default_service_name}, schema_url)
)
Expand Down

0 comments on commit 127464b

Please sign in to comment.