Skip to content

Commit 6ff0c90

Browse files
fix(ai): Preserve null values during normalization
Refs: https://linear.app/getsentry/issue/PY-2043 Co-Authored-By: benry <ben.henry@sentry.io>
1 parent 8b2c7b0 commit 6ff0c90

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sentry_sdk/ai/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def _normalize_data(data: "Any", unpack: bool = True) -> "Any":
485485
if isinstance(data, dict):
486486
return {k: _normalize_data(v, unpack=unpack) for (k, v) in data.items()}
487487

488-
return data if isinstance(data, (int, float, bool, str)) else str(data)
488+
return data if data is None or isinstance(data, (int, float, bool, str)) else str(data)
489489

490490

491491
def set_data_normalized(

0 commit comments

Comments
 (0)