-
Notifications
You must be signed in to change notification settings - Fork 24
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
Very rough draft for pydantic v2 #4
Very rough draft for pydantic v2 #4
Conversation
thomasaarholt
commented
Jul 18, 2023
- Downgrade Sphinx to compatible version
- Bump package version to v0.5.0
- very rough draft for pydantic v2
@thomasaarholt What else needs to be done to push this over the edge? |
@JakobGM @thomasaarholt Polars just bumped the minimum version for pydantic to v2.0 pola-rs/polars#10923. It would be nice if we can also get pydantic 2.0 support in patito, otherwise users are stuck on Polars 0.19.1. |
I completely agree. Jakob and I are both on very full schedules at the moment and are trying to find time to finish off the work that we started in this branch: https://github.com/JakobGM/patito/tree/jakobgm/patito-v2 |
I see! If there are some small things I could help out with; I can try to familiarize myself more with the codebase and make some additions, but I probably would need some pointers. |
We did not realize this dependency clash with patito. We'll revert this change for now, so you'll be able to use |
Thanks @stinodego. Hopefully won't be much longer before we bump it ourselves. |
If my understanding is correct, a major outstanding issue is the forced json conversion of pydantic v2
now raises
Attempting to modernize to
raises
when the user calls One possibility would be to specify the dtypes with string equivalents, but polars does not seem to support this style. Another possibility would be to subclass Using the example in
Calling |
@brendancooley with regards to the datatype serialisation not working is something which needs to be done upstream. I think it's just a matter of using Serde in Polars. API wise it would be less ideal to have to pass all these custom fields to json_schema_extra. The Patito API should handle that. |
Very much agree that patito custom fields ought to be exposed directly. Is there an open issue for polars dtype serialization? |
@brendancooley I don't think so, can you create one in Polars? A while ago I created one for pl.struct and it was added within 2 days. If @thomasaarholt @JakobGM could share what perhaps is still outstanding then I think the community can contribute to those things to speed up the migration :) |
Looks like we would also need them to support the serialization of Expressions, to make the
with
|
Working on collecting a list of sub-issues for this on #28 |
Took a hack at finishing this up on #32. Feedback from existing users would be very helpful. In particular if folks could add tests that isolate issues introduced by upgrading onto this prototype would be very helpful. |