|
54 | 54 | from sqlalchemy.orm.instrumentation import is_instrumented |
55 | 55 | from sqlalchemy.sql.schema import MetaData |
56 | 56 | from sqlalchemy.sql.sqltypes import LargeBinary, Time, Uuid |
57 | | -from typing_extensions import Annotated, Literal, TypeAlias, deprecated, get_args, get_origin |
| 57 | +from typing_extensions import ( |
| 58 | + Annotated, |
| 59 | + Literal, |
| 60 | + TypeAlias, |
| 61 | + deprecated, |
| 62 | + get_args, |
| 63 | + get_origin, |
| 64 | +) |
58 | 65 |
|
59 | 66 | from ._compat import ( # type: ignore[attr-defined] |
60 | 67 | IS_PYDANTIC_V2, |
@@ -647,7 +654,7 @@ def __init__( |
647 | 654 | ModelMetaclass.__init__(cls, classname, bases, dict_, **kw) |
648 | 655 |
|
649 | 656 |
|
650 | | -def _get_sqlmodel_field_info_from_annotation(annotation: Any) -> Optional["FieldInfo"]: |
| 657 | +def _get_sqlmodel_field_info_from_annotation(annotation: Any) -> Optional[FieldInfo]: |
651 | 658 | """Extract SQLModel FieldInfo from an Annotated type's metadata. |
652 | 659 |
|
653 | 660 | When using Annotated[type, Field(...), Validator(...)], Pydantic V2 may create |
@@ -736,9 +743,7 @@ def get_sqlalchemy_type(field: Any, original_annotation: Any = None) -> Any: |
736 | 743 | raise ValueError(f"{type_} has no matching SQLAlchemy type") |
737 | 744 |
|
738 | 745 |
|
739 | | -def get_column_from_field( |
740 | | - field: Any, original_annotation: Any = None |
741 | | -) -> Column: # type: ignore |
| 746 | +def get_column_from_field(field: Any, original_annotation: Any = None) -> Column: # type: ignore |
742 | 747 | if IS_PYDANTIC_V2: |
743 | 748 | field_info = field |
744 | 749 | else: |
|
0 commit comments