Skip to content

warning_manager ¤

Classes:

  • WarningManager

    Manages warnings for the Pydantic model processing.

WarningManager dataclass ¤

WarningManager(warnings_list: list[tuple[type[Warning], str]] = list())

Manages warnings for the Pydantic model processing.

Example

manager = WarningManager()
manager.add_warning(ListOrderWarning, "Field 'items' is a list")
manager.emit_warnings()

Methods:

add_warning ¤

add_warning(warning_type: type[Warning], message: str) -> None

Add a warning to the list.

emit_warnings ¤

emit_warnings() -> None

Emit all collected warnings.