@@ -376,15 +376,11 @@ def _create_span_limits(
376376
377377 attribute_value_length_limit = config .attribute_value_length_limit
378378 if attribute_value_length_limit is None and global_limits is not None :
379- attribute_value_length_limit = (
380- global_limits .attribute_value_length_limit
381- )
379+ attribute_value_length_limit = global_limits .attribute_value_length_limit
382380
383381 return SpanLimits (
384382 max_span_attributes = (
385- attribute_count_limit
386- if attribute_count_limit is not None
387- else _DEFAULT_OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT
383+ attribute_count_limit if attribute_count_limit is not None else _DEFAULT_OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT
388384 ),
389385 max_events = (
390386 config .event_count_limit if config .event_count_limit is not None else _DEFAULT_OTEL_SPAN_EVENT_COUNT_LIMIT
@@ -403,14 +399,10 @@ def _create_span_limits(
403399 else _DEFAULT_OTEL_LINK_ATTRIBUTE_COUNT_LIMIT
404400 ),
405401 max_attribute_length = (
406- attribute_value_length_limit
407- if attribute_value_length_limit is not None
408- else SpanLimits .UNSET
402+ attribute_value_length_limit if attribute_value_length_limit is not None else SpanLimits .UNSET
409403 ),
410404 max_span_attribute_length = (
411- attribute_value_length_limit
412- if attribute_value_length_limit is not None
413- else SpanLimits .UNSET
405+ attribute_value_length_limit if attribute_value_length_limit is not None else SpanLimits .UNSET
414406 ),
415407 )
416408
@@ -440,16 +432,12 @@ def create_tracer_provider(
440432 _create_id_generator (config .id_generator ) if config is not None and config .id_generator is not None else None
441433 )
442434 if config is not None and config .limits is not None :
443-
444435 limits = config .limits
445436
446437 else :
447-
448438 limits = SpanLimitsConfig ()
449439
450- span_limits = _create_span_limits (
451- limits , global_attribute_limits
452- )
440+ span_limits = _create_span_limits (limits , global_attribute_limits )
453441
454442 provider = TracerProvider (
455443 resource = resource ,
@@ -484,6 +472,4 @@ def configure_tracer_provider(
484472 """
485473 if config is None :
486474 return
487- trace .set_tracer_provider (
488- create_tracer_provider (config , resource , global_attribute_limits )
489- )
475+ trace .set_tracer_provider (create_tracer_provider (config , resource , global_attribute_limits ))
0 commit comments