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.
▬▬▬▬ About the podcast ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
This video is the uncut, live recording of the Talk Python To Me podcast ( https://talkpython.fm ). We cover Python-focused topics every week and publish the edited and polished version in audio form. Subscribe in your podcast player of choice (100% free) at https://talkpython.fm/subscribe.
▬▬▬▬ Guests ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Roman
Roman on Twitter: / roman_the_right
▬▬▬▬ Links and resources from the show ▬▬▬▬▬▬▬▬▬▬▬▬
Beanie: beanie-https://beanie-odm.dev/
Beanie on GitHub: https://github.com/roman-right/beanie
Beanie Release 1.21.0: https://github.com/roman-right/beanie...
Talk Python's MongoDB with Async Python Course: https://training.talkpython.fm/course...
Pydantic Migration Guide: https://docs.pydantic.dev/2.0/migration/
Customizing validation with _get_pydantic_core_schema__: https://docs.pydantic.dev/latest/usag...
Bunnet (Sync Beanie): https://github.com/roman-right/bunnet
Generic `typing.ForwardRef` to support generic recursive types: https://discuss.python.org/t/generic-...
Pydantic v2 - The Plan Episode: https://talkpython.fm/episodes/show/3...
Future of Pydantic and FastAPI episode: https://talkpython.fm/episodes/show/4...
Beanie Lazy Parsing: https://beanie-odm.dev/tutorial/lazy-...
Beanie Relationships: https://beanie-odm.dev/tutorial/relat...
Locust Load Testing: https://locust.io/
motor package: https://pypi.org/project/motor/
Listen this episode on Talk Python: https://talkpython.fm/episodes/show/4...
Episode transcripts: https://talkpython.fm/episodes/transc...
▬▬▬▬ Dive deeper ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Listen to the Talk Python To Me podcast at https://talkpython.fm Over 250 hours of Python courses at https://training.talkpython.fm/courses Follow us on on Mastodon. Michael: https://fosstodon.org/@mkennedy & Talk Python https://fosstodon.org/@talkpython