Company
Date Published
Author
Sydney Runkle
Word count
1071
Language
English
Hacker News points
None

Summary

Pydantic v2.9 introduces a series of enhancements, including performance improvements, new features, and several fixes. The release supports complex number validation and serialization, explicit ZoneInfo handling, a new val_json_bytes setting for consistent JSON round-tripping, and allows customization of JSON schema with custom validators. Performance improvements focus on reducing schema building times and memory allocations, achieving up to a 10x increase in import speed for users with numerous models. Notable improvements include a tagged union serializer, enhanced error messages for annotation compatibility issues, and a shift of certain errors to the validation phase. The update also includes changes such as merging dict type json_schema_extra values, supporting sibling keys to $ref, and deprecating dict usage in the Examples class. The release reflects contributions from over 25 contributors, with specific acknowledgments to individuals who made significant contributions, and introduces Pydantic Logfire, a new observability tool available for free trial.