File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -460,12 +460,12 @@ def is_field_noneable(field: "FieldInfo") -> bool:
460460 )
461461 return field .allow_none # type: ignore[no-any-return, attr-defined]
462462
463- # def get_sa_type_from_field(field: Any) -> Any:
464- # if field is Literal:
465- # return AutoString
466- # elif isinstance(field.type_, type) and field.shape == SHAPE_SINGLETON:
467- # return field.type_
468- # raise ValueError(f"The field {field.name} has no matching SQLAlchemy type")
463+ def get_sa_type_from_field (field : Any ) -> Any :
464+ if get_origin ( field . type_ ) is Literal :
465+ return AutoString
466+ elif isinstance (field .type_ , type ) and field .shape == SHAPE_SINGLETON :
467+ return field .type_
468+ raise ValueError (f"The field { field .name } has no matching SQLAlchemy type" )
469469
470470 def get_field_metadata (field : Any ) -> Any :
471471 metadata = FakeMetadata ()
You can’t perform that action at this time.
0 commit comments