The Wire · Showcase
PYDANTIC FIXES DEFAULT FACTORY VALIDATION BUG, SQLALCHEMY PATCHES ORM ISSUE
By RepoJournal · Filed · About FastAPI & Pydantic
Pydantic shipped a fix for a validation edge case where default factories weren't receiving validated data, solving a real-world pattern that's been breaking in production.
Pydantic's default factory handling [1] now correctly passes validated field data to factories that need it, closing the loop on issue #13266 where validation context was getting lost. This is the kind of fix that looks small in the PR but catches developers who've been working around it with manual validation logic. SQLAlchemy 2.0.50 landed in SQLModel [2] with an ORM fix for joinedload combined with of_type() on joined-table subclasses, addressing a relatively narrow but high-impact case for polymorphic queries. If you're using either pattern, the chain stops breaking today.
One email a day. Unsubscribe in one click.
Keep up with FastAPI & Pydantic in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade pydantic to the latest patch - default factory validation is now correct pydantic/pydantic [plan]
- → Update SQLAlchemy to 2.0.50 via SQLModel if you use polymorphic joinedloads tiangolo/sqlmodel [plan]
References
- [1] Handle missing errors with default factories taking validated data ↗ pydantic/pydantic
- [2] ⬆ Bump sqlalchemy from 2.0.49 to 2.0.50 ↗ tiangolo/sqlmodel