Skip to content

Commit

Permalink
keep Dict for now, but use type:ignore to silence
Browse files Browse the repository at this point in the history
  • Loading branch information
adsharma committed Mar 1, 2025
1 parent 66297ee commit 9de3d86
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,15 +598,11 @@ def sqlmodel_rebuild(cls) -> None:
reg._dispose_manager_and_mapper(m)
del reg._managers[m]

return cls.__do_init__(cls.__name__, cls.__bases__, cls.__dict__)
return cls.__do_init__(cls.__name__, cls.__bases__, cls.__dict__) # type: ignore (Dict vs Mapping)

# Override SQLAlchemy, allow both SQLAlchemy and plain Pydantic models
def __do_init__(
cls,
classname: str,
bases: Tuple[type, ...],
dict_: Mapping[str, Any],
**kw: Any,
cls, classname: str, bases: Tuple[type, ...], dict_: Dict[str, Any], **kw: Any
) -> None:
# Only one of the base classes (or the current one) should be a table model
# this allows FastAPI cloning a SQLModel for the response_model without
Expand Down

0 comments on commit 9de3d86

Please sign in to comment.