Skip to content
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

Pydantic v2 #10

Closed
jplock opened this issue Sep 21, 2023 · 5 comments
Closed

Pydantic v2 #10

jplock opened this issue Sep 21, 2023 · 5 comments

Comments

@jplock
Copy link

jplock commented Sep 21, 2023

Support Pydantic v2

@nayaverdier
Copy link
Owner

This is currently blocked by pydantic/pydantic#7586 in order to support KEYS_ONLY / INCLUDE indexes. Depending on where that ticket goes, I might just leave that feature unimplemented for now when using Pydantic v2 to at least support the majority of the feature set with Pydantic v2.

@jsjeannotte
Copy link

jsjeannotte commented Nov 3, 2023

Hi @nayaverdier ! I was wondering if you've made progress on this? We are down to a handful of dependencies still pinned on v1 (including Dyntastic), and a lot of libraries are already pinned to Pydantic >1 (one of our systems uses a VENV with a combination of ~1300 Python dependencies/versions, so we're dealing with conflict resolution on a daily bases ... fun times ...)

Depending on where that ticket goes, I might just leave that feature unimplemented for now when using Pydantic v2 to at least support the majority of the feature set with Pydantic v2

That would be great! One approach would be to release a dyntastic2 pinned to Pydantic 2 without the blockers, and over time, getting it to parity. This would allow folks still stuck on Pydantic v1 to use dyntastic, and for others to use dyntastic2 with Pydantic v2.
We tried convincing the Pydantic maintainers to release V2 as a new package to improve the transition but we were not successful (pydantic/pydantic#6523), so now we deal with this pain every week.
My colleague wrote a great post on this here: https://jolynch.github.io/posts/semver_considered_harmful/

By the way, thanks again for the great library, our team at Netflix is leveraging it to build some of our Data Platform control planes. When I find the time, I have some improvements to suggest (we've built automated audit fields with auto-conflict detection to handle concurrent save() calls, but could be nice to move those feature upstream). Will send an incomplete PR to share what it looks like when I get some free cycles.

@nayaverdier
Copy link
Owner

@jsjeannotte Thanks for the push, I just released 0.13.0a1 which has pydantic v2 support. There were a lot of tricky things to work around, so if you're able to play around with it and make sure it actually works for your use case, that'd be super helpful. If nobody complains, I'll release it in a week or two.

Looking forward to seeing the PR!

@jsjeannotte
Copy link

@nayaverdier Thanks, will try it today and report back.

@nayaverdier
Copy link
Owner

0.13.0 is now released, closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants