@@ -839,15 +839,16 @@ def __tablename__(cls) -> str:
839839 return cls .__name__ .lower ()
840840
841841 @classmethod
842- def model_validate ( # type: ignore[override]
842+ def model_validate (
843843 cls : Type [_TSQLModel ],
844844 obj : Any ,
845845 * ,
846846 strict : Union [bool , None ] = None ,
847847 from_attributes : Union [bool , None ] = None ,
848848 context : Union [Dict [str , Any ], None ] = None ,
849- update : Union [ Dict [ str , Any ], None ] = None ,
849+ ** kwargs : Any ,
850850 ) -> _TSQLModel :
851+ update = kwargs .get ("update" , None )
851852 return sqlmodel_validate (
852853 cls = cls ,
853854 obj = obj ,
@@ -857,25 +858,28 @@ def model_validate( # type: ignore[override]
857858 update = update ,
858859 )
859860
860- def model_dump ( # type: ignore[override]
861+ def model_dump (
861862 self ,
862863 * ,
863864 mode : Union [Literal ["json" , "python" ], str ] = "python" ,
864865 include : Union [IncEx , None ] = None ,
865866 exclude : Union [IncEx , None ] = None ,
866- context : Union [Dict [ str , Any ] , None ] = None ,
867- by_alias : bool = False ,
867+ context : Union [Any , None ] = None ,
868+ by_alias : Union [ bool , None ] = False ,
868869 exclude_unset : bool = False ,
869870 exclude_defaults : bool = False ,
870871 exclude_none : bool = False ,
871872 round_trip : bool = False ,
872873 warnings : Union [bool , Literal ["none" , "warn" , "error" ]] = True ,
874+ fallback : Callable [[Any ], Any ] | None = ...,
873875 serialize_as_any : bool = False ,
874876 ) -> Dict [str , Any ]:
875877 if PYDANTIC_MINOR_VERSION >= (2 , 7 ):
878+ assert isinstance (context , Dict )
876879 extra_kwargs : Dict [str , Any ] = {
877880 "context" : context ,
878881 "serialize_as_any" : serialize_as_any ,
882+ "fallback" : fallback ,
879883 }
880884 else :
881885 extra_kwargs = {}
@@ -893,6 +897,7 @@ def model_dump( # type: ignore[override]
893897 ** extra_kwargs ,
894898 )
895899 else :
900+ assert by_alias is not None
896901 return super ().dict (
897902 include = include ,
898903 exclude = exclude ,
0 commit comments