From 20b0259d0f779b6f5f492cb88c667918b006e443 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Tue, 7 Oct 2025 21:59:13 +0200 Subject: [PATCH 1/2] Fix `model_dump` signature --- sqlmodel/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlmodel/main.py b/sqlmodel/main.py index 38c85915aa..8c2dc13387 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -868,6 +868,7 @@ def model_dump( exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: Union[bool, Literal["none", "warn", "error"]] = True, fallback: Union[Callable[[Any], Any], None] = None, @@ -893,6 +894,7 @@ def model_dump( exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, + exclude_computed_fields=exclude_computed_fields, round_trip=round_trip, warnings=warnings, **extra_kwargs, From da76d1ad80bf276dad5280c5c5ebc2caf11dc123 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Tue, 7 Oct 2025 22:25:36 +0200 Subject: [PATCH 2/2] Ignore `Cannot inherit from final class "FieldInfo" ` --- sqlmodel/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlmodel/main.py b/sqlmodel/main.py index 8c2dc13387..125a2a6fa8 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -109,7 +109,7 @@ def __dataclass_transform__( return lambda a: a -class FieldInfo(PydanticFieldInfo): +class FieldInfo(PydanticFieldInfo): # type: ignore[misc] def __init__(self, default: Any = Undefined, **kwargs: Any) -> None: primary_key = kwargs.pop("primary_key", False) nullable = kwargs.pop("nullable", Undefined)