@@ -625,15 +625,15 @@ def test_conversation_id_propagates_to_span_with_gen_ai_operation_name(
625625 span .set_data ("gen_ai.operation.name" , "chat" )
626626
627627 spans = [item .payload for item in items if item .type == "span" ]
628- span_data = spans [0 ]["data " ]
628+ span_data = spans [0 ]["attributes " ]
629629 assert span_data .get ("gen_ai.conversation.id" ) == "conv-op-name-test"
630630
631631 def test_conversation_id_propagates_to_span_with_ai_op (
632- self , sentry_init , capture_events
632+ self , sentry_init , capture_items
633633 ):
634634 """Span with ai.* op should get conversation_id."""
635635 sentry_init (traces_sample_rate = 1.0 )
636- events = capture_events ( )
636+ items = capture_items ( "span" )
637637
638638 scope = sentry_sdk .get_current_scope ()
639639 scope .set_conversation_id ("conv-ai-op-test" )
@@ -642,8 +642,8 @@ def test_conversation_id_propagates_to_span_with_ai_op(
642642 with start_span (op = "ai.chat.completions" ):
643643 pass
644644
645- ( event ,) = events
646- span_data = event [ " spans" ] [0 ]["data " ]
645+ spans = [ item . payload for item in items if item . type == "span" ]
646+ span_data = spans [0 ]["attributes " ]
647647 assert span_data .get ("gen_ai.conversation.id" ) == "conv-ai-op-test"
648648
649649 def test_conversation_id_propagates_to_span_with_gen_ai_op (
0 commit comments