Skip to content

Commit 2ebcb18

Browse files
author
Liudmila Molkova
committed
clean up
1 parent 3e74d5c commit 2ebcb18

File tree

2 files changed

+5
-15
lines changed
  • opentelemetry-api/src/opentelemetry/util
  • opentelemetry-sdk/src/opentelemetry/sdk/resources

2 files changed

+5
-15
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
None,
2929
]
3030

31-
3231
AttributeValue = AnyValue
3332
Attributes = Optional[Mapping[str, AnyValue]]
3433

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,8 @@
9090
except ImportError:
9191
pass
9292

93-
LabelValue = Union[
94-
str,
95-
bool,
96-
int,
97-
float,
98-
Sequence[str],
99-
Sequence[bool],
100-
Sequence[int],
101-
Sequence[float],
102-
]
103-
Attributes = typing.Mapping[str, LabelValue]
93+
LabelValue = AttributeValue
94+
Attributes = AllAttributes
10495
logger = logging.getLogger(__name__)
10596

10697
CLOUD_PROVIDER = ResourceAttributes.CLOUD_PROVIDER
@@ -173,7 +164,7 @@ class Resource:
173164

174165
def __init__(
175166
self,
176-
attributes: AllAttributes,
167+
attributes: Attributes,
177168
schema_url: typing.Optional[str] = None,
178169
):
179170
self._attributes = BoundedAttributes(attributes=attributes)
@@ -183,7 +174,7 @@ def __init__(
183174

184175
@staticmethod
185176
def create(
186-
attributes: typing.Optional[AllAttributes] = None,
177+
attributes: typing.Optional[Attributes] = None,
187178
schema_url: typing.Optional[str] = None,
188179
) -> "Resource":
189180
"""Creates a new `Resource` from attributes.
@@ -254,7 +245,7 @@ def get_empty() -> "Resource":
254245
return _EMPTY_RESOURCE
255246

256247
@property
257-
def attributes(self) -> AllAttributes:
248+
def attributes(self) -> Attributes:
258249
return self._attributes
259250

260251
@property

0 commit comments

Comments
 (0)