File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 4040 inspect ,
4141)
4242from sqlalchemy import Enum as sa_Enum
43- from sqlalchemy import types as sa_types
4443from 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 (
You can’t perform that action at this time.
0 commit comments