Skip to content

Commit 2551fe1

Browse files
committed
revert models.py changes, use raw dicts without modifying codegen
Python dataclasses don't enforce types at runtime, so factory functions can accept raw dicts directly. This removes the need to change TextMapPropagator from a @DataClass to a TypeAlias. Assisted-by: Claude Opus 4.6 (1M context)
1 parent 9f192e5 commit 2551fe1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • opentelemetry-sdk/src/opentelemetry/sdk/_configuration

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/models.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,12 @@ class SpanProcessor:
573573
simple: SimpleSpanProcessor | None = None
574574

575575

576-
# Diverges from codegen: TextMapPropagator is typed as dict[str, Any] rather
577-
# than a dataclass so that unknown propagator names (plugin/custom propagators)
578-
# are preserved as dict keys through the config pipeline.
579-
TextMapPropagator: TypeAlias = dict[str, Any]
576+
@dataclass
577+
class TextMapPropagator:
578+
tracecontext: TraceContextPropagator | None = None
579+
baggage: BaggagePropagator | None = None
580+
b3: B3Propagator | None = None
581+
b3multi: B3MultiPropagator | None = None
580582

581583

582584
@dataclass

0 commit comments

Comments
 (0)