Talk Python to Me is a weekly podcast hosted by developer and entrepreneur Michael Kennedy. We dive deep into the popular packages and software developers, data scientists, and incredible hobbyists doing amazing things with Python. If you're new to Python, you'll quickly learn the ins and outs of the community by hearing from the leaders. And if you've been Pythoning for years, you'll learn about your favorite packages and the hot new ones coming out of open source.

#432: Migrating to Pydantic 2.0: Beanie for MongoDB

October 06, 2023 00:53:54 52.02 MB Downloads: 0
By now, surely you've heard how awesome Pydantic version 2 is. The team led by Samual Colvin spent almost a year refactoring and reworking the core into a high-performance Rust version while keeping the public API in Python and largely unchanged. The main benefit of this has been massive speed ups for frameworks and devs using Pydantic.

But just how much work is it to take a framework deeply built on Pydantic and make that migration? What are some of the pitfalls? On this episode, we welcome back Roman Right to talk about his experience converting Beanie, the popular MongoDB async framework based on Pydantic, from Pydantic v1 to v2. And we'll have some fun talking MongoDB as well while we are at it.


Links from the show

Beanie: beanie-odm.dev
Beanie on GitHub: github.com
Roman on Twitter: @roman_the_right
Beanie Release 1.21.0: github.com
Talk Python's MongoDB with Async Python Course: talkpython.fm
Pydantic Migration Guide: docs.pydantic.dev

Customizing validation with __get_pydantic_core_schema__: docs.pydantic.dev
Bunnet (Sync Beanie): github.com
Generic `typing.ForwardRef` to support generic recursive types: discuss.python.org
Pydantic v2 - The Plan Episode: talkpython.fm
Future of Pydantic and FastAPI episode: talkpython.fm
Beanie Lazy Parsing: beanie-odm.dev
Beanie Relationships: beanie-odm.dev
Locust Load Testing: locust.io
motor package: pypi.org
Watch this episode on YouTube: youtube.com
Episode transcripts: talkpython.fm

--- Stay in touch with us ---
Subscribe to us on YouTube: youtube.com
Follow Talk Python on Mastodon: talkpython
Follow Michael on Mastodon: mkennedy

Sponsors
Studio 3T
Talk Python Training