Closed dbirman closed 1 month ago
A future release may fix this https://github.com/pydantic/pydantic/issues/10344.
If time is short for fixing this may be worth pinning for a couple of weeks.
A future release may fix this pydantic/pydantic#10344.
If time is short for fixing this may be worth pinning for a couple of weeks.
Okay finally had the time to look at what you had posted over there and I finally get the error. Thanks for posting that and getting it fixed (hopefully) upstream.
Another option would be to write a version of model_construct() for ourselves that creates required fields with None. I think it's just a matter of an else
in this statement https://github.com/pydantic/pydantic/blob/204e109691c69583e656c6e16a62ad79da2f59b9/pydantic/main.py#L291C1-L291C39 that sets the value to None
These remaining issues are due to the use of model_construct() on classes with required fields (that then don't get generated. Something about pydantic 2.9 changed and these are sneaking past our attempt to ignore validation errors. Separating this from the issues Bruno fixed already