-
Notifications
You must be signed in to change notification settings - Fork 16
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 #157
Comments
Worth mentioning they have a |
Also apparently there is an automatic migration tool https://github.com/pydantic/bump-pydantic#installation |
(FYI) Ran into this when I accidentally had pydantic 2.1.1
|
Yep, they're definitely not designing it to be API-for-API compatible. |
WIP on PR #214. Noting:
|
PR #214 tests have a few holes left.
@dataclass
class C:
p: h.Prefixed = 1.1 # <= this gets converted inline
# So do these:
C(p=1)
C(p=Decimal("3.1415") The custom data types feature is pretty well overhauled in Pydantic v2. Definitely for the better, but different. The way to do this now is something like: # Just add this `Annotated` thing
Prefixed = Annotated[Prefixed, BeforeValidator(to_prefixed) Quite a bit nicer way to get the custom validation and checking. Couple options I can think of:
|
Prior comments spawned some other, smaller issues including: And the resolution on |
Hi @dan-fritchman, thanks so much for all the effort you have put into this, it's really exciting to explore the integrations this will enable. I was wondering, are #218 and #215 the blocking aspects for, say, a pre-release of a pydantic v2 version? Depending if 3.7 and 3.8 support is depreciated assuming they both are reaching end of life #217 |
Here is how I am thinking about what must (and might) be in the next release: #220 |
@daquintero where is that Python version/ release chart from BTW? |
Ahh this is great for the next release, thanks! The diagram is from here https://devguide.python.org/versions/ and it's really helps managing the target support for releases imo |
Terrific that is quite helpful. |
Live in v6 at https://pypi.org/project/hdl21/6.0.0/ |
Came faster than expected: https://twitter.com/pydantic/status/1674820177005887508
The text was updated successfully, but these errors were encountered: