Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 983edc6

Browse files
jakemalachowskitoumorokoshi
authored andcommitted
Add int and valid sequences to AttributeValue type (open-telemetry#368)
The OT Spec states one of the valid AttributeValue types are: An array of primitive type values. The array MUST be homogeneous, i.e. it MUST NOT contain values of different types. This change updates the AttributeValue type to include homogeneous sequences of str, bool, int, and float
1 parent 4f71fba commit 983edc6

File tree

1 file changed

+12
-3
lines changed
  • opentelemetry-api/src/opentelemetry/util

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@
1313
# limitations under the License.
1414

1515

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

18-
AttributeValue = typing.Union[str, bool, float]
19-
Attributes = typing.Optional[typing.Dict[str, AttributeValue]]
18+
AttributeValue = Union[
19+
str,
20+
bool,
21+
int,
22+
float,
23+
Sequence[str],
24+
Sequence[bool],
25+
Sequence[int],
26+
Sequence[float],
27+
]
28+
Attributes = Optional[Dict[str, AttributeValue]]

0 commit comments

Comments
 (0)