Skip to content

Upgrading pydantic 0.2 to 0.3

Breaking0.2.1 → 0.3Breaking3New4Changed1Fixed1Other1

BreakingUpgrade verdict

3 breaking changes.

  • Removes setattr as __setattr__ is now intelligent.
  • Removes raise_exception; models now always raise exceptions.
  • Removes instance method validators.
3 items need code or config changes
Breaking3
Removes setattr as __setattr__ is now intelligent.
setattr__setattr__
Removes raise_exception; models now always raise exceptions.
raise_exception
Removes instance method validators.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: field ValidatorSignature.BOUND_METHOD
  • changed: constructor Field(*, name: str, type_: Type, alias: str=…, class_validators: dict=…, default: Any=…, required: bool=…, allow_none: bool=…, description: str=…) → constructor Field(*, name: str, type_: Type, alias: str=…, class_validators: dict=…, default: Any=…, required: bool=…, allow_none: bool=…, model_config: Any=…, description: str=…)
  • changed: method Field.validate(v, model, index=…) → method Field.validate(v, values, index=…)
  • changed: static method Field.infer(*, name, value, annotation, class_validators, field_config) → static method Field.infer(*, name, value, annotation, class_validators, config)
  • removed: field BaseConfig.raise_exception
  • removed: method BaseModel.setattr(name, value)
  • removed: property BaseModel.errors
  • changed: constructor BaseModel(**values) → constructor BaseModel(**data)
  • added: field BaseConfig.allow_mutation
  • added: method BaseModel.copy(*, include: Set[str]=…, exclude: Set[str]=…, update: Dict[str, Any]=…)
  • added: static method BaseModel.construct(**values)
  • changed: static method DSN.validate(value, model, **kwarg) → static method DSN.validate(value, values, **kwarg)
  • added: class StrictStr(str)
  • added: field DSN.fields
  • added: static method StrictStr.get_validators()
  • added: static method StrictStr.validate(v)
  • changed: function anystr_length_validator(v, model, **kwargs) → function anystr_length_validator(v, config, **kwargs)
  • changed: function number_size_validator(v, model, **kwargs) → function number_size_validator(v, config, **kwargs)