Skip to content

core: upgrade pydantic v1 to v2

Latest

Choose a tag to compare

@nedhirouebnou nedhirouebnou released this 20 Apr 15:12
· 1 commit to master since this release

What's changed

Upgrades pydantic from ^1.10.8 to ^2.7. Pydantic v1 has been in maintenance-only mode since mid-2023; this keeps the project current and compatible with the rest of the v2 ecosystem.

Breaking changes

  • Optional fields now require explicit = None defaults in hrflow/schemas.py — v2 no longer implicitly defaults Optional to None
  • Location._fields renamed to Location.fields — v2 rejects leading-underscore field names
  • If you were monkey-patching or relying on validate_assignment being off, note that the no-op model_config declaration has been removed from test schemas

Files changed

  • hrflow/schemas.py — core model updates
  • hrflow/scoring.py, hrflow/searching.py — util call site fixes
  • tests/utils/schemas.py — full rewrite away from v1-specific APIs (@root_validator, @validator, constr/conint/confloat/conlist)

Migration

If you use hrflow as a library and subclass or reference its Pydantic models directly, audit your Optional field defaults and any _-prefixed field names before upgrading.