Skip to content

Commit 0400b28

Browse files
committed
Fix other mypy warnings in main.py
1 parent 6cebb55 commit 0400b28

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sqlmodel/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,10 @@ 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,
584+
super().__new__(cls, name, bases, dict_used, **config_kwargs)
585+
)
583586
new_cls.__annotations__ = {
584587
**relationship_annotations,
585588
**pydantic_annotations,
@@ -610,7 +613,7 @@ def get_config(name: str) -> Any:
610613
new_cls.model_config["read_from_attributes"] = True # type: ignore[typeddict-unknown-key]
611614
# For compatibility with older versions
612615
# TODO: remove this in the future
613-
new_cls.model_config["read_with_orm_mode"] = True
616+
new_cls.model_config["read_with_orm_mode"] = True # type: ignore[typeddict-unknown-key]
614617

615618
config_registry = get_config("registry")
616619
if config_registry is not Undefined:
@@ -792,7 +795,7 @@ def get_column_from_field(field: Any) -> Column: # type: ignore
792795
)
793796
if sa_column_kwargs is not Undefined:
794797
kwargs.update(cast(dict[Any, Any], sa_column_kwargs))
795-
return Column(sa_type, *args, **kwargs) # type: ignore
798+
return Column(sa_type, *args, **kwargs)
796799

797800

798801
class_registry = weakref.WeakValueDictionary() # type: ignore

0 commit comments

Comments
 (0)