Skip to content

Commit ec95a7f

Browse files
committed
🐛 Update type annotations for compatibility with Python 3.6
1 parent 6bd5cd8 commit ec95a7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sqlmodel/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def Field(
152152
foreign_key: Optional[Any] = None,
153153
nullable: Union[bool, UndefinedType] = Undefined,
154154
index: Union[bool, UndefinedType] = Undefined,
155-
sa_column: Union[Column[Any], UndefinedType] = Undefined,
155+
sa_column: Union[Column, UndefinedType] = Undefined, # type: ignore
156156
sa_column_args: Union[Sequence[Any], UndefinedType] = Undefined,
157157
sa_column_kwargs: Union[Mapping[str, Any], UndefinedType] = Undefined,
158158
schema_extra: Optional[Dict[str, Any]] = None,

sqlmodel/sql/sqltypes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from sqlalchemy.types import CHAR, TypeDecorator
99

1010

11-
class AutoString(types.TypeDecorator[types.String]):
11+
class AutoString(types.TypeDecorator): # type: ignore
1212

1313
impl = types.String
1414
cache_ok = True
@@ -23,7 +23,7 @@ def load_dialect_impl(self, dialect: Dialect) -> "types.TypeEngine[Any]":
2323

2424
# Reference form SQLAlchemy docs: https://docs.sqlalchemy.org/en/14/core/custom_types.html#backend-agnostic-guid-type
2525
# with small modifications
26-
class GUID(TypeDecorator[Any]):
26+
class GUID(TypeDecorator): # type: ignore
2727
"""Platform-independent GUID type.
2828
2929
Uses PostgreSQL's UUID type, otherwise uses
@@ -34,7 +34,7 @@ class GUID(TypeDecorator[Any]):
3434
impl = CHAR
3535
cache_ok = True
3636

37-
def load_dialect_impl(self, dialect: Dialect) -> TypeEngine[Any]:
37+
def load_dialect_impl(self, dialect: Dialect) -> TypeEngine: # type: ignore
3838
if dialect.name == "postgresql":
3939
return dialect.type_descriptor(UUID()) # type: ignore
4040
else:

0 commit comments

Comments
 (0)