Upgrading pydantic 0.5 to 0.6
Review needed0.5 → 0.6.4Deprecated1New5Fixed4
Review neededUpgrade verdict
1 deprecation.
In plain terms
- The old way of getting a model's values is deprecated; use the new method instead.
Must act 1 item needs code or config changes
Nothing in this upgrade needs a code or configuration change.
Deprecations to plan for
Deprecated1
Deprecates
values(...) in favor of .dict(...).values().dict()API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export validator
- changed:
function parse_date(value: StrIntFloat) -> date → function parse_date(value: Union[date, StrIntFloat]) -> date - changed:
function parse_datetime(value: StrIntFloat) -> datetime → function parse_datetime(value: Union[datetime, StrIntFloat]) -> datetime - changed:
function parse_time(value: StrIntFloat) -> time → function parse_time(value: Union[time, StrIntFloat]) -> time
- added:
class SettingsError(ValueError)
- changed:
constructor Field(*, name: str, type_: Type, alias: str=…, class_validators: dict=…, default: Any=…, required: bool=…, allow_none: bool=…, model_config: Any=…, description: str=…) → constructor Field(*, name: str, type_: Type, alias: str=…, class_validators: List[Validator]=…, default: Any=…, required: bool=…, allow_none: bool=…, model_config: Any=…, description: str=…) - changed:
method Field.validate(v, values, index=…) → method Field.validate(v, values, index=…, cls=…) - added:
class Validator(NamedTuple) - added:
field Validator.always: bool - added:
field Validator.func: Callable - added:
field Validator.pre: bool - added:
field Validator.whole: bool - added:
field ValidatorSignature.CLS_JUST_VALUE - added:
field ValidatorSignature.CLS_VALUE_KWARGS
- changed:
method BaseModel.values(*, include: Set[str]=…, exclude: Set[str]=…) -> Dict[str, Any] → method BaseModel.values(**kwargs) - added:
field BaseConfig.validate_assignment - added:
function validator(*fields, pre: bool=…, whole: bool=…, always: bool=…) - added:
method BaseModel.dict(*, include: Set[str]=…, exclude: Set[str]=…) -> Dict[str, Any]