fL ir>dZddlmZddlZddlmZmZmZddl m Z ddl m Z ddl mZdd lmZdd lmZd Zd ed ZedZGddZGddeeZGddeeZGddeeZGddeZGddeZGddeZee Z!y)zPydantic-specific errors.) annotationsN)AnyClassVarLiteral)Self) Qualifier)_repr)getattr_migration) version_short)PydanticUserErrorPydanticUndefinedAnnotationPydanticImportErrorPydanticSchemaGenerationErrorPydanticInvalidForJsonSchemaPydanticForbiddenQualifierPydanticErrorCodeszhttps://errors.pydantic.dev/z/u/)0zclass-not-fully-definedzcustom-json-schemazdecorator-missing-fieldzdiscriminator-no-fieldzdiscriminator-alias-typezdiscriminator-needs-literalzdiscriminator-aliaszdiscriminator-validatorzcallable-discriminator-no-tagztyped-dict-versionzmodel-field-overriddenzmodel-field-missing-annotationz config-bothzremoved-kwargszcircular-reference-schemainvalid-for-json-schemazjson-schema-already-usedzbase-model-instantiatedundefined-annotationschema-for-unknown-type import-errorzcreate-model-field-definitionszvalidator-no-fieldszvalidator-invalid-fieldszvalidator-instance-methodzvalidator-input-typezroot-validator-pre-skipz model-serializer-instance-methodzvalidator-field-config-infozvalidator-v1-signaturezvalidator-signaturezfield-serializer-signaturezmodel-serializer-signaturezmultiple-field-serializerszinvalid-annotated-typeztype-adapter-config-unusedzroot-model-extrazunevaluable-type-annotationz dataclass-init-false-extra-allowzclashing-init-and-init-varzmodel-config-invalid-field-namezwith-config-on-modelzdataclass-on-modelzvalidate-call-typezunpack-typed-dictzoverlapping-unpack-typed-dictzinvalid-self-typez validate-by-alias-and-name-falsec eZdZdZddZddZy)PydanticErrorMixinzA mixin class for common functionality shared by all Pydantic-specific errors. Attributes: message: A message describing the error. code: An optional error code from PydanticErrorCodes enum. c ||_||_y)Nmessagecode)selfrrs U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pydantic/errors.py__init__zPydanticErrorMixin.__init__Zs  ct|j |jS|jdt|jS)Nz For further information visit )rrDEV_ERROR_DOCS_URL)rs r__str__zPydanticErrorMixin.__str__^s: 99 << ll^#EFXEYZ^ZcZcYde er!N)rstrrzPydanticErrorCodes | NonereturnNone)r&r%)__name__ __module__ __qualname____doc__r r$r!rrrRsfr!rceZdZdZy)r z1An error raised due to incorrect use of Pydantic.N)r(r)r*r+r,r!rr r es;r!r c6eZdZdZdfd ZeddZxZS)rzA subclass of `NameError` raised when handling undefined annotations during `CoreSchema` generation. Attributes: name: Name of the error. message: Description of the error. c6||_t| |dy)Nrr)namesuperr )rr0r __class__s rr z$PydanticUndefinedAnnotation.__init__qs  /EFr!c |j}||t |S#t$r1tjdt |j d}YLwxYw)zConvert a `NameError` to a `PydanticUndefinedAnnotation` error. Args: name_error: `NameError` to be converted. Returns: Converted `PydanticUndefinedAnnotation` error. z .*'(.+?)'r )r0r)r0AttributeErrorresearchr%group)cls name_errorr0s rfrom_name_errorz+PydanticUndefinedAnnotation.from_name_errorusV E??Dc*o66 E99\3z?;AA!DD Es !7AA)r0r%rr%r&r')r9 NameErrorr&r)r(r)r*r+r classmethodr: __classcell__r2s@rrris"G 7 7r!rc$eZdZdZdfd ZxZS)rzAn error raised when an import fails due to module changes between V1 and V2. Attributes: message: Description of the error. c(t||dy)Nrrr1r rrr2s rr zPydanticImportError.__init__s ~6r!rr%r&r'r(r)r*r+r r=r>s@rrrs 77r!rc$eZdZdZdfd ZxZS)rzAn error raised during failures to generate a `CoreSchema` for some type. Attributes: message: Description of the error. c(t||dy)NrrArBrCs rr z&PydanticSchemaGenerationError.__init__ '@Ar!rDrEr>s@rrr BBr!rc$eZdZdZdfd ZxZS)rzAn error raised during failures to generate a JSON schema for some `CoreSchema`. Attributes: message: Description of the error. c(t||dy)NrrArBrCs rr z%PydanticInvalidForJsonSchema.__init__rHr!rDrEr>s@rrrrIr!rcBeZdZUdZdddddddZd ed <d fd ZxZS) rzLAn error raised if a forbidden type qualifier is found in a type annotation.ztyping.Requiredztyping.NotRequiredztyping.ReadOnlyztyping.ClassVarzdataclasses.InitVarz typing.Final)required not_required read_only class_varinit_varfinalzClassVar[dict[Qualifier, str]]_qualifier_repr_mapcvt|dtj|d|j|ddy)NzThe annotation z contains the z? type qualifier, which is invalid in the context it is defined.r)r1r r display_as_typerS)r qualifier annotationr2s rr z#PydanticForbiddenQualifier.__init__sN !%"7"7 "C!FnUYUmUmnwUxT{|QR  r!)rVrrWrr&r')r(r)r*r+rS__annotations__r r=r>s@rrrs4V&,&&) ;7  r!r)"r+ __future__r _annotationsr5typingrrrtyping_extensionsrtyping_inspection.introspectionrpydantic._internalr _migrationr versionr __all__r#rr TypeErrorr r;r ImportErrorrrrrr( __getattr__r,r!rres2 ))"5$)" 4MO3DCH/(1hff&<*I<7"4i7:7,k7B$5BB#4B !2 , ) r!