-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Pydantic 2.0 #1539
Comments
Blockers:
|
+1, Recommend! |
I can help you with this. |
Sounds great! Have you worked with pydantic internals much before? There's a branch that some contributors have started working on getting sqlmodel going with pydantic v2 that is where I started a few weeks ago: fastapi/sqlmodel#632 Then the next step is getting reflex Base working with pydantic v2. I don't remember the exact errors I was hitting a few weeks ago, but trying to find a public alternative to ModelField was one of the main blockers. Since all reflex Vars and State is based on pydantic, there's quite a bit to fix up. Good luck, check in and let us know how it's going. Getting to pydantic v2 / sqlalchemy v2 will be big for Reflex. |
NO i hevent.😣 |
sqlmodel 0.0.14 has been released with pydantic v2 support: https://github.com/tiangolo/sqlmodel/releases/tag/0.0.14 |
This is blocking me as most of the libraries I am using on my project have moved to Pydantic 2! |
@masenf I'm not sure how you're using ModelField internally, but does this help: https://docs.pydantic.dev/2.0/migration/#changes-to-validators-allowed-signatures Looks like there is an approach documented for migration. |
I would add to the issues the fact that Poetry output when resolving deps |
There is a WiP branch: masenf/pydantic-v2 that I started on, but has been put on hold while the team worked on the radix components. Now that's done, work may resume on pydantic v2 upgrade... but there are quite a few non-trivial bits that were blocking before and I don't think any of them have been resolved. Moving to v2 will require architectural work, and it's not clear if reflex should take that pydantic v2 dependency or try to retool onto dataclasses/attrs and raw sqlalchemy instead. Pydantic v1 was great for getting Reflex off the ground, but if the work required to accommodate v2 is too great, then it might make more sense to not take the dependency at all and reduce the footprint and abstraction layers needed to use Reflex. |
We should update to the latest Pydantic version to benefit from performance improvements and compatibility with other libraries that are migrating.
The text was updated successfully, but these errors were encountered: