@@ -579,7 +579,9 @@ def __new__(
579579 config_kwargs = {
580580 key : kwargs [key ] for key in kwargs .keys () & allowed_config_kwargs
581581 }
582- new_cls = super ().__new__ (cls , name , bases , dict_used , ** config_kwargs )
582+ new_cls = cast (
583+ "SQLModel" , super ().__new__ (cls , name , bases , dict_used , ** config_kwargs )
584+ )
583585 new_cls .__annotations__ = {
584586 ** relationship_annotations ,
585587 ** pydantic_annotations ,
@@ -607,10 +609,10 @@ def get_config(name: str) -> Any:
607609 # This could be done by reading new_cls.model_config['table'] in FastAPI, but
608610 # that's very specific about SQLModel, so let's have another config that
609611 # other future tools based on Pydantic can use.
610- new_cls .model_config ["read_from_attributes" ] = True
612+ new_cls .model_config ["read_from_attributes" ] = True # type: ignore[typeddict-unknown-key]
611613 # For compatibility with older versions
612614 # TODO: remove this in the future
613- new_cls .model_config ["read_with_orm_mode" ] = True
615+ new_cls .model_config ["read_with_orm_mode" ] = True # type: ignore[typeddict-unknown-key]
614616
615617 config_registry = get_config ("registry" )
616618 if config_registry is not Undefined :
@@ -792,7 +794,7 @@ def get_column_from_field(field: Any) -> Column: # type: ignore
792794 )
793795 if sa_column_kwargs is not Undefined :
794796 kwargs .update (cast (dict [Any , Any ], sa_column_kwargs ))
795- return Column (sa_type , * args , ** kwargs ) # type: ignore
797+ return Column (sa_type , * args , ** kwargs )
796798
797799
798800class_registry = weakref .WeakValueDictionary () # type: ignore
0 commit comments