Skip to content

Commit 54dbce5

Browse files
committed
fix signature of model_dump
1 parent c8b6dec commit 54dbce5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sqlmodel/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,19 +864,21 @@ def model_dump(
864864
mode: Union[Literal["json", "python"], str] = "python",
865865
include: Union[IncEx, None] = None,
866866
exclude: Union[IncEx, None] = None,
867-
context: Union[Dict[str, Any], None] = None,
868-
by_alias: bool = False,
867+
context: Union[Any, None] = None,
868+
by_alias: Union[bool, None] = False,
869869
exclude_unset: bool = False,
870870
exclude_defaults: bool = False,
871871
exclude_none: bool = False,
872872
round_trip: bool = False,
873873
warnings: Union[bool, Literal["none", "warn", "error"]] = True,
874+
fallback: Union[Callable[[Any], Any], None] = None,
874875
serialize_as_any: bool = False,
875876
) -> Dict[str, Any]:
876877
if PYDANTIC_MINOR_VERSION >= (2, 7):
877878
extra_kwargs: Dict[str, Any] = {
878879
"context": context,
879880
"serialize_as_any": serialize_as_any,
881+
"fallback": fallback,
880882
}
881883
else:
882884
extra_kwargs = {}
@@ -894,6 +896,7 @@ def model_dump(
894896
**extra_kwargs,
895897
)
896898
else:
899+
assert by_alias is not None
897900
return super().dict(
898901
include=include,
899902
exclude=exclude,

0 commit comments

Comments
 (0)