new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Pydantic · all subjects

errors/error-codes

152 notes in this subject, read out of this brain and free to use. This is page 2 of 3.

missing_keyword_only_argument error when required keyword-only arg not passed

The missing_keyword_only_argument error is raised when a required keyword-only argument is not passed to a function decorated with validate_call.

missing_positional_only_argument error when required positional-only arg not passed

The missing_positional_only_argument error is raised when a required positional-only argument is not passed to a function decorated with validate_call.

missing_sentinel_error when experimental MISSING sentinel not provided

The missing_sentinel_error is raised when the experimental MISSING sentinel is the only value allowed and was not provided during validation.

model_attributes_type error when input is not valid dictionary or model

The model_attributes_type error is raised when the input value is not a valid dictionary, model instance, or instance that fields can be extracted from.

model_type error when input is not model instance or dict

The model_type error is raised when the input to a model is not an instance of the model or dict.

multiple_of error when value is not multiple of constraint

The multiple_of error is raised when the input is not a multiple of a field's multiple_of constraint.

named_tuple_type error when input is invalid for named tuple field

The named_tuple_type error is raised when the input value is not valid for a named tuple field.

needs_python_object error when validation requires Python object

The needs_python_object error is raised when validation is attempted from a format that cannot be converted to a Python object, such as checking isinstance or issubclass from JSON.

no_such_attribute error when assigning to non-existent field with validate_assignment=True

The no_such_attribute error is raised when validate_assignment=True in the config and you attempt to assign a value to an attribute that is not an existing field.

none_required error when value is not None for field requiring None

The none_required error is raised when the input value is not None for a field that requires None.

none_required pitfall with naming collision between field name and type

The none_required validation error can occur when there is a naming collision in a model between a field name and its type, with the field having a default value of None. For example, a field named 'int' with type int and default None will cause this error.

recursion_loop error when cyclic reference detected

The recursion_loop error is raised when a cyclic reference is detected during validation.

set_item_not_hashable error when unhashable value in set/frozenset

The set_item_not_hashable error is raised when an unhashable value is validated against a set or frozenset.

set_type error when value type is invalid for set field

The set_type error is raised when the value type is not valid for a set field.

string_not_ascii error when string contains non-ASCII characters

The string_not_ascii error is raised when the input string contains non-ASCII characters with StringConstraints(ascii_only=True).

string_pattern_mismatch error when value doesn't match pattern constraint

The string_pattern_mismatch error is raised when the input value does not match the field's pattern constraint.

string_sub_type error when value is strict subtype of str in strict mode

The string_sub_type error is raised when the value is an instance of a strict subtype of str when the field is strict.

string_type error when input type is invalid for str field

The string_type error is raised when the input value's type is not valid for a str field. This error is also raised for strict fields when the input value is not an instance of str.

string_unicode error when value cannot be parsed as Unicode string

The string_unicode error is raised when the value cannot be parsed as a Unicode string.

time_delta_parsing error when string cannot be parsed for timedelta field

The time_delta_parsing error is raised when the input value is a string that cannot be parsed for a timedelta field.

time_delta_type error when input type is invalid for timedelta field

The time_delta_type error is raised when the input value's type is not valid for a timedelta field. This error is also raised for strict fields when the input value is not an instance of timedelta.

time_parsing error when string cannot be parsed for time field

The time_parsing error is raised when the input value is a string that cannot be parsed for a time field.

time_type error when value type is invalid for time field

The time_type error is raised when the value type is not valid for a time field. This error is also raised for strict fields when the input value is not an instance of time.

timezone_aware error when datetime lacks timezone info for timezone-aware field

The timezone_aware error is raised when the datetime value provided for a timezone-aware datetime field doesn't have timezone information.

timezone_naive error when datetime has timezone info for naive field

The timezone_naive error is raised when the datetime value provided for a timezone-naive datetime field has timezone info.

too_long error when value length exceeds max_length constraint

The too_long error is raised when the input value's length is greater than the field's max_length constraint.

too_short error when value length is less than min_length constraint

The too_short error is raised when the value length is less than the field's min_length constraint.

tuple_type error when input type is invalid for tuple field

The tuple_type error is raised when the input value's type is not valid for a tuple field. This error is also raised for strict fields when the input value is not an instance of tuple.

unexpected_keyword_argument error with validate_call or dataclass

The unexpected_keyword_argument error is raised when you provide a value by keyword for a positional-only argument while calling a function decorated with validate_call, or when using pydantic.dataclasses with extra=forbid.

unexpected_positional_argument error when positional arg provided for keyword-only param

The unexpected_positional_argument error is raised when you provide a positional value for a keyword-only argument while calling a function decorated with validate_call.

union_tag_invalid error when discriminator value is not expected

The union_tag_invalid error is raised when the input's discriminator is not one of the expected values.

union_tag_not_found error when discriminator value cannot be extracted

The union_tag_not_found error is raised when it is not possible to extract a discriminator value from the input.

url_parsing error when value cannot be parsed as URL

The url_parsing error is raised when the input value cannot be parsed as a URL.

url_scheme error when URL scheme is invalid for field type

The url_scheme error is raised when the URL scheme is not valid for the URL type of the field, such as using ftp:// with HttpUrl.

url_syntax_violation error when URL syntax is not valid

The url_syntax_violation error is raised when the URL syntax is not valid.

url_too_long error when URL length exceeds 2083 characters

The url_too_long error is raised when the URL length is greater than 2083.

url_type error when input type is invalid for URL field

The url_type error is raised when the input value's type is not valid for a URL field.

uuid_parsing error when input value cannot be parsed as UUID

The uuid_parsing error is raised when the input value cannot be parsed as a UUID.

uuid_type error when input type is invalid for UUID field

The uuid_type error is raised when the input value's type is not valid as instance for a UUID field (valid types are str, bytes, or UUID).

uuid_version error when input value does not match UUID version

The uuid_version error is raised when the input value does not match the specified UUID version.

value_error when ValueError raised during validation

The value_error is raised when a ValueError is raised during validation, such as in a field_validator.

multiple_argument_values error when multiple values provided for single argument

The multiple_argument_values error is raised when you provide multiple values for a single argument while calling a function decorated with validate_call.

arguments_type error when function arguments are invalid

The arguments_type error is raised when an object passed as arguments to a function during validation is not a tuple, list, or dict.

assertion_error raised when assert statement fails during validation

The assertion_error is raised when a failing assert statement is encountered during validation, such as in a field_validator.

bool_parsing error for invalid string to boolean coercion

The bool_parsing error is raised when an input value is a string that is not valid for coercion to a boolean, for example the string 'test'.

bool_type error when input type is invalid for bool field

The bool_type error is raised when the input value's type is not valid for a bool field, such as None. This error is also raised for strict fields when the input value is not an instance of bool.

bytes_invalid_encoding error when bytes value is invalid under configured encoding

The bytes_invalid_encoding error is raised when a bytes value is invalid under the configured encoding, for example 'a' is invalid hex because it has an odd number of digits.

bytes_too_long error when bytes length exceeds max_length

The bytes_too_long error is raised when the length of a bytes value is greater than the field's max_length constraint.

bytes_too_short error when bytes length is less than min_length

The bytes_too_short error is raised when the length of a bytes value is less than the field's min_length constraint.

bytes_type error when input type is invalid for bytes field

The bytes_type error is raised when the input value's type is not valid for a bytes field, such as 123. This error is also raised for strict fields when the input value is not an instance of bytes.

callable_type error when input is not a valid callable

The callable_type error is raised when the input value is not valid as a callable, such as when using ImportString[Callable] with an invalid import path.

complex_str_parsing error when string cannot be parsed as complex number

The complex_str_parsing error is raised when the input value is a string that cannot be parsed as a complex number because it does not follow Python's complex number string format rules.

complex_type error when input cannot be interpreted as complex number

The complex_type error is raised when the input value cannot be interpreted as a complex number, such as passing False.

dataclass_exact_type error when dataclass validation fails with strict=True

The dataclass_exact_type error is raised when validating a dataclass with strict=True and the input is not an instance of the dataclass.

dataclass_type error when input is invalid for dataclass field

The dataclass_type error is raised when the input value is not valid for a dataclass field.

date_from_datetime_inexact error when datetime has nonzero time component for date field

The date_from_datetime_inexact error is raised when the input datetime value provided for a date field has a nonzero time component. For a timestamp to parse into a date field, the time components must all be zero.

date_parsing error when JSON string cannot be parsed for date field

The date_parsing error is raised when validating JSON where the input value is a string that cannot be parsed for a date field with strict=True.

datetime_future error when value is not in the future for FutureDatetime field

The datetime_future error is raised when the value provided for a FutureDatetime field is not in the future.

datetime_object_invalid error when datetime object is invalid

The datetime_object_invalid error is raised when something about the datetime object is not valid, such as a custom timezone that does not implement utcoffset.

datetime_parsing error when string cannot be parsed for datetime field

The datetime_parsing error is raised when the value is a string that cannot be parsed for a datetime field with strict=True.

Give your agent this brain