Skip to content

Commit 1f0e0ea

Browse files
committed
cleanup
1 parent 7e55022 commit 1f0e0ea

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sqlmodel/main.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
inspect,
4141
)
4242
from sqlalchemy import Enum as sa_Enum
43-
from sqlalchemy import types as sa_types
4443
from sqlalchemy.orm import (
4544
Mapped,
4645
RelationshipProperty,
@@ -656,16 +655,12 @@ def get_sqlalchemy_type(field: Any) -> Any:
656655
type_ = get_sa_type_from_field(field)
657656
metadata = get_field_metadata(field)
658657

659-
# If it's already an SQLAlchemy type (eg. AutoString), use it directly
660-
if isinstance(type_, type) and issubclass(type_, sa_types.TypeEngine):
661-
return type_
662-
663658
# Checks for `Literal` type annotation
664659
if type_ is Literal:
665660
return AutoString
666661
# Check enums first as an enum can also be a str, needed by Pydantic/FastAPI
667662
if issubclass(type_, Enum):
668-
return sa_Enum(cast(Type[Enum], type_))
663+
return sa_Enum(type_)
669664
if issubclass(
670665
type_,
671666
(

0 commit comments

Comments
 (0)