You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions like this one are causing us an issue. We are constructing Line from an already-constructed Line_Common instance. The code fails because it expects a dict instead.
I think that the best solution is to make them mode="after" validators instead. I have found it to always be better to use after validators unless I really need to perform some manipulation before Pydantic has run its type conversions. If this function were an after validator then it self would always be a constructed model.
Would you be OK with such a change? We could submit a PR.
The text was updated successfully, but these errors were encountered:
Originally it was done with mode="after" and _fields_set = self.model_fields_set, but there was something from Pydantic that was breaking the logic. It could have been how defaults are handled, so we'd get back to #7.
Functions like this one are causing us an issue. We are constructing
Line
from an already-constructedLine_Common
instance. The code fails because it expects a dict instead.I think that the best solution is to make them
mode="after"
validators instead. I have found it to always be better to use after validators unless I really need to perform some manipulation before Pydantic has run its type conversions. If this function were an after validator then itself
would always be a constructed model.Would you be OK with such a change? We could submit a PR.
The text was updated successfully, but these errors were encountered: