PydanticUndefinedAnnotation
A subclass of NameError raised when handling undefined annotations during CoreSchema generation.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | `str | None` |
| message | str | Description of the error. |
Constructor
Signature
def PydanticUndefinedAnnotation(
name: str | None,
message: str
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| name | `str | None` |
| message | str | A descriptive error message explaining the context of the NameError. |
Signature
def PydanticUndefinedAnnotation(
name: str | None,
message: str
)
Parameters
| Name | Type | Description |
|---|---|---|
| name | `str | None` |
| message | str | The 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
| Name | Type | Description |
|---|---|---|
| name_error | NameError | NameError to be converted. |
Returns
| Type | Description |
|---|---|
Self | Converted PydanticUndefinedAnnotation error. |