Change8

Migrating to Pydantic v2.13.0b1

Version v2.13.0b1 introduces 1 breaking change. This guide details how to update your code.

Released: 2/23/2026

1
Breaking Changes
2
Migration Steps
6
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

pydantic.v1PydanticUserErrorFieldInfoInitVarpydantic.Fieldcreate_model

Breaking Changes

Issue #1

PydanticUserError is now raised as a RuntimeError instead of a TypeError. Code relying on catching TypeError for Pydantic validation errors must be updated to catch RuntimeError or PydanticUserError directly.

Migration Steps

  1. 1
    Update code that catches validation errors to catch `RuntimeError` instead of `TypeError` if it was specifically targeting `PydanticUserError`.
  2. 2
    If using polymorphic serialization, review usage of `serialize_as_any` and consider using the new `polymorphic_serialization` option.

Release Summary

This beta release focuses on bug fixes and performance improvements for validation and serialization, notably introducing the `polymorphic_serialization` option and updating the internal `pydantic-core` repository structure.

Need More Details?

View the full release notes and all changes for Pydantic v2.13.0b1.

View Full Changelog