Skip to content

Commit 76e940d

Browse files
committed
make _ComponentConfig.additional_properties typing more specific
Values in additional_properties are either nested config dicts (for **kwargs splatting) or None. Document this with a more concrete type annotation. Note: the Protocol's instance-attribute declaration still diverges from the generated model's ClassVar; tracked separately. Assisted-by: Claude Opus 4.6
1 parent 8d1f3ff commit 76e940d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,14 @@ def load_entry_point(group: str, name: str) -> type:
7575

7676

7777
class _ComponentConfig(Protocol):
78-
"""Protocol for config dataclasses decorated with @_additional_properties."""
78+
"""Protocol for config dataclasses decorated with @_additional_properties.
7979
80-
additional_properties: dict[str, Any]
80+
Values in ``additional_properties`` are nested config dicts (suitable
81+
for ``**kwargs`` splatting to the user-defined component class) or
82+
``None`` (when the YAML uses ``my_plugin:`` or ``my_plugin: null``).
83+
"""
84+
85+
additional_properties: dict[str, dict[str, Any] | None]
8186

8287

8388
def _resolve_component(

0 commit comments

Comments
 (0)