Skip to content

Commit a84d0fc

Browse files
ref: Remove references to unsupported attribute types
1 parent 3373da2 commit a84d0fc

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

sentry_sdk/utils.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,23 +2062,15 @@ def format_attribute(val: "Any") -> "AttributeValue":
20622062
if isinstance(val, (bool, int, float, str)):
20632063
return val
20642064

2065-
# Only lists of elements of a single type are supported
2066-
list_types: 'dict[type, Literal["string[]", "integer[]", "double[]", "boolean[]"]]' = {
2067-
str: "string[]",
2068-
int: "integer[]",
2069-
float: "double[]",
2070-
bool: "boolean[]",
2071-
}
2072-
20732065
if isinstance(val, (list, tuple)) and not val:
20742066
return []
20752067
elif isinstance(val, list):
20762068
ty = type(val[0])
2077-
if ty in list_types and all(type(v) is ty for v in val):
2069+
if ty in (str, int, float, bool) and all(type(v) is ty for v in val):
20782070
return copy.deepcopy(val)
20792071
elif isinstance(val, tuple):
20802072
ty = type(val[0])
2081-
if ty in list_types and all(type(v) is ty for v in val):
2073+
if ty in (str, int, float, bool) and all(type(v) is ty for v in val):
20822074
return list(val)
20832075

20842076
return safe_repr(val)

0 commit comments

Comments
 (0)