Skip to content

Commit

Permalink
🎨 Fix type annotations in _compat
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Dec 4, 2023
1 parent b995766 commit b3fcaf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlmodel/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def is_field_noneable(field: "FieldInfo") -> bool:
return False
return False

def get_type_from_field(field: Any) -> type:
def get_type_from_field(field: Any) -> Any:
type_: Any = field.annotation
# Resolve Optional fields
if type_ is None:
Expand Down Expand Up @@ -429,7 +429,7 @@ def is_field_noneable(field: "FieldInfo") -> bool:
)
return field.allow_none # type: ignore[no-any-return, attr-defined]

def get_type_from_field(field: Any) -> type:
def get_type_from_field(field: Any) -> Any:
if isinstance(field.type_, type) and field.shape == SHAPE_SINGLETON:
return field.type_
raise ValueError(f"The field {field.name} has no matching SQLAlchemy type")
Expand Down

0 comments on commit b3fcaf0

Please sign in to comment.