Skip to content

Commit b991725

Browse files
committed
fix
1 parent cf6b48b commit b991725

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlmodel/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,13 @@ def get_sqlalchemy_type(field: Any) -> Any:
799799
return base_type_to_sa_type(type_, metadata)
800800

801801

802-
def get_column_from_field(field: Any) -> Column: # type: ignore
802+
def get_column_from_field(field: Any) -> Union[Column, MappedSQLExpression[Any]]: # type: ignore
803803
if IS_PYDANTIC_V2:
804804
field_info = field
805805
else:
806806
field_info = field.field_info
807807
sa_column = getattr(field_info, "sa_column", Undefined)
808-
if isinstance(sa_column, Column):
808+
if isinstance(sa_column, (Column, MappedSQLExpression[Any])):
809809
return sa_column
810810
sa_type = get_sqlalchemy_type(field)
811811
primary_key = getattr(field_info, "primary_key", Undefined)

0 commit comments

Comments
 (0)