Skip to content

Commit

Permalink
Replace AnyValue type to opentelemetry.util.types
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-Alnosairi committed Sep 16, 2024
1 parent ae7b32a commit 33c0254
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 4 additions & 1 deletion opentelemetry-api/src/opentelemetry/util/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# limitations under the License.


from typing import Mapping, Optional, Sequence, Tuple, Union
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union

AnyValue = Union[
str, bool, int, float, bytes, List["AnyValue"], Dict[str, "AnyValue"], None
]
AttributeValue = Union[
str,
bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import warnings
from os import environ
from time import time_ns
from typing import Any, Callable, Dict, List, Optional, Tuple, Union # noqa
from typing import Any, Callable, Optional, Tuple, Union # noqa

from opentelemetry._logs import Logger as APILogger
from opentelemetry._logs import LoggerProvider as APILoggerProvider
Expand Down Expand Up @@ -50,7 +50,7 @@
get_current_span,
)
from opentelemetry.trace.span import TraceFlags
from opentelemetry.util.types import Attributes
from opentelemetry.util.types import AnyValue, Attributes

_logger = logging.getLogger(__name__)

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

warnings.simplefilter("once", LogDroppedAttributesWarning)

AnyValue = Union[
str, bool, int, float, bytes, List["AnyValue"], Dict[str, "AnyValue"], None
]


class LogLimits:
"""This class is based on a SpanLimits class in the Tracing module.
Expand Down

0 comments on commit 33c0254

Please sign in to comment.