avoid compare types:FunctionType

This commit is contained in:
honglei 2023-08-15 00:59:49 +08:00
parent ce0064b286
commit a0b84c574d

View File

@ -177,7 +177,7 @@ def Field(
) -> Any:
current_schema_extra = schema_extra or {}
if default is PydanticUndefined:
if type(sa_column) is types.FunctionType: #lambda
if isinstance(sa_column, types.FunctionType): #lambda
sa_column_ = sa_column()
else:
sa_column_ = sa_column