Skip to main content

PydanticUndefinedAnnotation

A subclass of NameError raised when handling undefined annotations during CoreSchema generation.

Attributes

AttributeTypeDescription
name`strNone`
messagestrDescription of the error.

Constructor

Signature

def PydanticUndefinedAnnotation(
name: str | None,
message: str
) - > None

Parameters

NameTypeDescription
name`strNone`
messagestrA descriptive error message explaining the context of the NameError.

Signature

def PydanticUndefinedAnnotation(
name: str | None,
message: str
)

Parameters

NameTypeDescription
name`strNone`
messagestrThe descriptive error message explaining the context of the undefined annotation.

Methods


from_name_error()

@classmethod
def from_name_error(
name_error: NameError
) - > Self

Convert a NameError to a PydanticUndefinedAnnotation error.

Parameters

NameTypeDescription
name_errorNameErrorNameError to be converted.

Returns

TypeDescription
SelfConverted PydanticUndefinedAnnotation error.