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 · API reference · all subjects

validation errors

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

literal_error validation error

This error is raised when the input value is not one of the expected literal values.

datetime_from_date_parsing error

This error is raised when the input value is a string that cannot be parsed for a datetime field, such as an invalid month like '2023-13-01'.

datetime_future error

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

datetime_object_invalid error

This error is raised when something about the datetime object is not valid, such as an incomplete timezone implementation on an AwareDatetime field.

datetime_parsing error

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

datetime_past error

This error is raised when the value provided for a PastDatetime field is not in the past.

decimal_max_places error

This error is raised when the value provided for a Decimal has too many digits after the decimal point, exceeding the decimal_places constraint.

decimal_parsing error

This error is raised when the value provided for a Decimal could not be parsed as a decimal number.

decimal_type error

This error is raised when the value provided for a Decimal is of the wrong type. It is also raised for strict fields when the input value is not an instance of Decimal.

list_type error

This error is raised when the input value's type is not valid for a list field.

decimal_max_digits error

This error is raised when the value provided for a Decimal has too many digits, exceeding the max_digits constraint.

arguments_type error

This error is raised when an object that would be passed as arguments to a function during validation is not a tuple, list, or dict. It occurs when using TypeAdapter to validate function arguments.

assertion_error validation error

This error is raised when a failing assert statement is encountered during validation, such as within a field_validator.

bool_parsing error

This error is raised when the input value is a string that is not valid for coercion to a boolean. The string 'true' is valid, but 'test' is not.

bool_type error

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

bytes_invalid_encoding error

This error is raised when a bytes value is invalid under the configured encoding. For example, when val_json_bytes is set to 'hex', 'a' is invalid because it has an odd number of digits.

bytes_too_long error

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

bytes_too_short error

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

bytes_type error

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

callable_type error

This error is raised when the input value is not valid as a callable. It can occur when using ImportString with Callable types.

complex_str_parsing error

This error is raised when the input value is a string but cannot be parsed as a complex number because it does not follow Python's complex number rules. This occurs during JSON validation.

complex_type error

This error is raised when the input value cannot be interpreted as a complex number.

dataclass_exact_type error

This error is raised when validating a dataclass with strict=True and the input is not an instance of the dataclass. Without strict mode, dict inputs can be coerced to dataclass instances.

dataclass_type error

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

date_from_datetime_inexact error

This 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, all time components must be zero.

date_parsing error

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

decimal_whole_digits error

This error is raised when the value provided for a Decimal has more digits before the decimal point than max_digits - decimal_places (when both are specified).

default_factory_not_called error

This error is raised when a default factory taking validated data cannot be called because validation failed on previous fields.

dict_type error

This error is raised when the input value's type is not dict for a dict field.

ellipsis_error validation error

This error is raised when the input isn't the Ellipsis literal for an EllipsisType field.

enum validation error

This error is raised when the input value does not exist in an enum field's members.

extra_forbidden error

This error is raised when the input value contains extra fields, but model_config['extra'] == 'forbid'.

finite_number error

This error is raised when the value is infinite or too large to be represented as a 64-bit floating point number during validation.

float_parsing error

This error is raised when the value is a string that can't be parsed as a float.

float_type error

This error is raised when the input value's type is not valid for a float field.

fraction_parsing error

This error is raised when the value provided for a Fraction could not be parsed as a fraction.

fraction_type error

This error is raised when the value provided for a Fraction is of the wrong type.

frozen_field error

This error is raised when you attempt to assign a value to a field with frozen=True, or to delete such a field.

frozen_instance error

This error is raised when frozen is set in the configuration and you attempt to delete or assign a new value to any of the fields.

frozen_set_type error

This error is raised when the input value's type is not valid for a frozenset field.

get_attribute_error validation error

This error is raised when model_config['from_attributes'] == True and an error is raised while reading the attributes.

greater_than error

This error is raised when the value is not greater than the field's gt constraint.

greater_than_equal error

This error is raised when the value is not greater than or equal to the field's ge constraint.

int_from_float error

This error is raised when you provide a float value for an int field.

int_parsing error

This error is raised when the value can't be parsed as int.

int_parsing_size error

This error is raised when attempting to parse a Python or JSON value from a string outside the maximum range that Python str to int parsing permits. Python allows up to 4300 consecutive digit characters.

int_type error

This error is raised when the input value's type is not valid for an int field.

invalid_key error

This error is raised when attempting to validate a dict that has a key that is not an instance of str.

is_instance_of error

This error is raised when the input value is not an instance of the expected type. This can occur with arbitrary_types_allowed=True.

is_subclass_of error

This error is raised when the input value is not a subclass of the expected type.

iterable_type error

This error is raised when the input value is not valid as an Iterable.

iteration_error validation error

This error is raised when an error occurs during iteration over a value.

json_invalid error

This error is raised when the input value is not a valid JSON string when using the Json type.

json_type error

This error is raised when the input value is of a type that cannot be parsed as JSON when using the Json type.

less_than error

This error is raised when the input value is not less than the field's lt constraint.

less_than_equal error

This error is raised when the input value is not less than or equal to the field's le constraint.

mapping_type error

This error is raised when a problem occurs during validation due to a failure in a call to Mapping protocol methods, such as .items().

missing error

This error is raised when there are required fields missing from the input value.

missing_argument error with validate_call

This error is raised when a required positional-or-keyword argument is not passed to a function decorated with validate_call.

missing_keyword_only_argument error with validate_call

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

Give your agent this brain