File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -478,9 +478,12 @@ def start_span(
478478 if parent_span_context is not None and not isinstance (
479479 parent_span_context , SpanContext
480480 ):
481- raise TypeError (
482- "parent_span_context must be a SpanContext or None."
481+ logger .warning (
482+ "Invalid Span Context for %s: %s" ,
483+ current_span ,
484+ parent_span_context ,
483485 )
486+ parent_span_context = None
484487
485488 return NonRecordingSpan (context = parent_span_context )
486489
Original file line number Diff line number Diff line change @@ -128,8 +128,8 @@ def test_default_tracer_context_propagation_with_invalid_context(self):
128128 ctx = trace .set_span_in_context (
129129 RecordingSpan (context = "invalid_context" ) # type: ignore[reportArgumentType]
130130 )
131- with self . assertRaises ( TypeError ) :
132- tracer . start_span ( "test" , context = ctx )
131+ with tracer . start_span ( "test" , context = ctx ) as span :
132+ self . assertIsNone ( span . get_span_context () )
133133
134134 def test_span (self ):
135135 with self .assertRaises (TypeError ):
You can’t perform that action at this time.
0 commit comments