Skip to content

Commit 55a1035

Browse files
committed
default value
1 parent 0c3da75 commit 55a1035

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/tracing_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ def _set_input_attributes(span, template, send_pii, name, f, args, kwargs):
10161016
attributes[SPANDATA.GEN_AI_TOOL_DESCRIPTION] = docstring
10171017

10181018
attributes.update(_get_input_attributes(template, send_pii, args, kwargs))
1019-
span.update_data(attributes)
1019+
span.update_data(attributes or {})
10201020

10211021

10221022
def _set_output_attributes(span, template, send_pii, result):
@@ -1035,7 +1035,7 @@ def _set_output_attributes(span, template, send_pii, result):
10351035
attributes[SPANDATA.GEN_AI_TOOL_OUTPUT] = result
10361036

10371037
attributes.update(_get_output_attributes(template, send_pii, result))
1038-
span.update_data(attributes)
1038+
span.update_data(attributes or {})
10391039

10401040

10411041
def create_span_decorator(template, op=None, name=None, attributes=None):
@@ -1088,7 +1088,7 @@ async def async_wrapper(*args, **kwargs):
10881088
result = await f(*args, **kwargs)
10891089

10901090
_set_output_attributes(span, template, send_pii, result)
1091-
span.update_data(attributes)
1091+
span.update_data(attributes or {})
10921092

10931093
return result
10941094

@@ -1128,7 +1128,7 @@ def sync_wrapper(*args, **kwargs):
11281128
result = f(*args, **kwargs)
11291129

11301130
_set_output_attributes(span, template, send_pii, result)
1131-
span.update_data(attributes)
1131+
span.update_data(attributes or {})
11321132

11331133
return result
11341134

0 commit comments

Comments
 (0)