Skip to content

Commit 7ccbd5a

Browse files
committed
no support for array attributes yet
1 parent 3fffa7f commit 7ccbd5a

File tree

2 files changed

+8
-21
lines changed

2 files changed

+8
-21
lines changed

sentry_sdk/_types.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ class SDKInfo(TypedDict):
216216
Hint = Dict[str, Any]
217217

218218
AttributeValue = (
219-
str | bool | float | int | list[str] | list[bool] | list[float] | list[int]
219+
str | bool | float | int
220+
# TODO: relay support coming soon for
221+
# | list[str] | list[bool] | list[float] | list[int]
220222
)
221223
Attributes = dict[str, AttributeValue]
222224

@@ -229,10 +231,11 @@ class SDKInfo(TypedDict):
229231
"boolean",
230232
"double",
231233
"integer",
232-
"string[]",
233-
"boolean[]",
234-
"double[]",
235-
"integer[]",
234+
# TODO: relay support coming soon for:
235+
# "string[]",
236+
# "boolean[]",
237+
# "double[]",
238+
# "integer[]",
236239
],
237240
"value": AttributeValue,
238241
},

sentry_sdk/utils.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,21 +2057,5 @@ def serialize_attribute(val: "AttributeValue") -> "SerializedAttributeValue":
20572057
if isinstance(val, str):
20582058
return {"value": val, "type": "string"}
20592059

2060-
if isinstance(val, list):
2061-
if not val:
2062-
return {"value": val, "type": "string[]"}
2063-
2064-
# Only lists of elements of a single type are supported
2065-
list_types: 'dict[type, Literal["string[]", "integer[]", "double[]", "boolean[]"]]' = {
2066-
str: "string[]",
2067-
int: "integer[]",
2068-
float: "double[]",
2069-
bool: "boolean[]",
2070-
}
2071-
2072-
ty = type(val[0])
2073-
if ty in list_types and all(isinstance(v, ty) for v in val):
2074-
return {"value": val, "type": list_types[ty]}
2075-
20762060
# Coerce to string if we don't know what to do with the value
20772061
return {"value": safe_repr(val), "type": "string"}

0 commit comments

Comments
 (0)