Skip to content

Upgrading pydantic 0.8 to 0.9

Safe0.8 → 0.9.1New5Fixed2Other4

SafeUpgrade verdict

Only new features and fixes in this range.

  • Nothing in this range needs changes to your code. It adds features and fixes.
Nothing to change

No breaking, platform, security or deprecated items in this range.

Nothing in this upgrade needs a code or configuration change.

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

  • changed: function parse_time(value: Union[time, StrIntFloat]) -> time → function parse_time(value: Union[time, str]) -> time
  • changed: function inherit_config(self_config, parent_config) -> Type[BaseConfig] → function inherit_config(self_config: Type[BaseConfig], parent_config: Type[BaseConfig]) -> Type[BaseConfig]
  • added: field BaseConfig.anystr_strip_whitespace
  • added: static method BaseConfig.get_field_config(name)
  • removed: static method ConstrainedInt.validate(value: int) -> int
  • changed: field ConstrainedInt.gt: int → field ConstrainedInt.gt: Optional[int]
  • changed: field ConstrainedInt.lt: int → field ConstrainedInt.lt: Optional[int]
  • changed: field ConstrainedStr.curtail_length: int → field ConstrainedStr.curtail_length: Optional[int]
  • changed: field ConstrainedStr.max_length: int → field ConstrainedStr.max_length: Optional[int]
  • changed: field ConstrainedStr.min_length: int → field ConstrainedStr.min_length: Optional[int]
  • changed: field ConstrainedStr.regex → field ConstrainedStr.regex: Optional[Pattern]
  • changed: function constr(*, min_length=…, max_length=…, curtail_length=…, regex=…) -> Type[str] → function constr(*, strip_whitespace=…, min_length=…, max_length=…, curtail_length=…, regex=…) -> Type[str]
  • added: class ConstrainedDecimal(Decimal)
  • added: class ConstrainedFloat(float)
  • added: class NegativeFloat(ConstrainedFloat)
  • added: class PositiveFloat(ConstrainedFloat)
  • added: class UUID1(UUID)
  • added: class UUID3(UUID)
  • added: class UUID4(UUID)
  • added: class UUID5(UUID)
  • added: field ConstrainedDecimal.decimal_places: Optional[int]
  • added: field ConstrainedDecimal.gt: Union[None, int, float, Decimal]
  • added: field ConstrainedDecimal.lt: Union[None, int, float, Decimal]
  • added: field ConstrainedDecimal.max_digits: Optional[int]
  • added: field ConstrainedFloat.gt: Union[None, int, float]
  • added: field ConstrainedFloat.lt: Union[None, int, float]
  • added: field ConstrainedStr.strip_whitespace
  • added: field NegativeFloat.lt
  • added: field PositiveFloat.gt
  • added: function condecimal(*, gt=…, lt=…, max_digits=…, decimal_places=…) -> Type[Decimal]
  • added: function confloat(*, gt=…, lt=…) -> Type[float]
  • added: static method ConstrainedDecimal.get_validators()
  • added: static method ConstrainedDecimal.validate(value: Decimal) -> Decimal
  • added: static method ConstrainedFloat.get_validators()
  • changed: function anystr_length_validator(v, config, **kwargs) → function anystr_length_validator(v, field, config, **kwargs)
  • changed: function number_size_validator(v, config, **kwargs) → function number_size_validator(v, field, config, **kwargs)
  • changed: function uuid_validator(v) -> UUID → function uuid_validator(v, field, config, **kwargs) -> UUID
  • added: function anystr_strip_whitespace(v, field, config, **kwargs)
  • added: function decimal_validator(v) -> Decimal