| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Any idea on when a new release with this fix will be available? |
Sorry, something went wrong.
Not really, hopefully soon! |
Sorry, something went wrong.
That's alright, I'll follow your suggestion. Thanks for the quick reply! |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
Perfect, feel free to do it! |
Sorry, something went wrong.
…4N/sqlmodel into pydantic-2.12-integration
There was a problem hiding this comment.
Thanks for the work on this, @stickm4n!
This now looks good to merge to me. I've added in the tests from #1602 just for good measure, and refactored the code a bit using Yurii's suggestions. I think it's much easier to follow/maintain like this, without the continue & break statements.
Will yet run this by Tiangolo for a final review.
Note that another alternative to this PR is #1607 - if we decide to merge this, we can close the other one.
Sorry, something went wrong.
|
FYI PR #1607 works with __future__.annotations as well, whereas this one does not. |
Sorry, something went wrong.
Can you provide more details on this? |
Sorry, something went wrong.
|
Sure, I tested the following model with both PRs, with and without future annotations in Python 3.13: class CreateTimeMixin:
create_time: Annotated[AwareDatetime, Field(sa_type=DATETIME_TIMEZONE)]This PR failed to pick up on the annotated metadata when future annotations were enabled. |
Sorry, something went wrong.
Sorry, something went wrong.
|
merge it soon may be helpful for pydantic 2.12+ |
Sorry, something went wrong.
|
Thank you @stickm4n! And thanks everyone for the discussion here. I went with #1607 because that approach, moving the metadata to its own annotation will allow us (in the future) to stop sub-classing FieldInfo, which the Pydantic team have asked for. I also added a test with stringified annotations (from __future__ import annotations) and that PR fixes/passes that test. ✔️ The fix will be available in the next few hours in SQLModel 0.0.32 🚀 Given that, I'll now close this one. Thanks! ☕ |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
After pydantic update to support Python 3.14, different declaration syntax were affected by the changed.
I check and on pydantic side there is not changes on the resulting FieldInfo structure, at least at first glance.
In the tests I illustrated the 3 possible declaration syntax for annotations defined by pydantic and supported so far by sqlmodel. Two of them do not work any more with pydantic>=2.12!