Skip to content

Commit 33c0254

Browse files
committed
Replace AnyValue type to opentelemetry.util.types
1 parent ae7b32a commit 33c0254

File tree

2 files changed

+6
-7
lines changed
  • opentelemetry-api/src/opentelemetry/util
  • opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal

2 files changed

+6
-7
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
# limitations under the License.
1414

1515

16-
from typing import Mapping, Optional, Sequence, Tuple, Union
16+
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union
1717

18+
AnyValue = Union[
19+
str, bool, int, float, bytes, List["AnyValue"], Dict[str, "AnyValue"], None
20+
]
1821
AttributeValue = Union[
1922
str,
2023
bool,

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import warnings
2323
from os import environ
2424
from time import time_ns
25-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union # noqa
25+
from typing import Any, Callable, Optional, Tuple, Union # noqa
2626

2727
from opentelemetry._logs import Logger as APILogger
2828
from opentelemetry._logs import LoggerProvider as APILoggerProvider
@@ -50,7 +50,7 @@
5050
get_current_span,
5151
)
5252
from opentelemetry.trace.span import TraceFlags
53-
from opentelemetry.util.types import Attributes
53+
from opentelemetry.util.types import AnyValue, Attributes
5454

5555
_logger = logging.getLogger(__name__)
5656

@@ -69,10 +69,6 @@ class LogDroppedAttributesWarning(UserWarning):
6969

7070
warnings.simplefilter("once", LogDroppedAttributesWarning)
7171

72-
AnyValue = Union[
73-
str, bool, int, float, bytes, List["AnyValue"], Dict[str, "AnyValue"], None
74-
]
75-
7672

7773
class LogLimits:
7874
"""This class is based on a SpanLimits class in the Tracing module.

0 commit comments

Comments
 (0)