Skip to content

Commit

Permalink
Fix some typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Varkentin committed Jun 27, 2023
1 parent 1a5ef38 commit 9266acb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions sqlmodel/engine/result.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Generic, Iterator, List, Optional, Sequence, TypeVar
from typing import Any, Generic, Iterator, List, Optional, Sequence, TypeVar, Tuple

from sqlalchemy.engine.result import Result as _Result
from sqlalchemy.engine.result import ScalarResult as _ScalarResult

_T = TypeVar("_T")
_T = TypeVar("_T", bound=Tuple[Any, ...])


class ScalarResult(_ScalarResult[_T], Generic[_T]):
Expand Down
4 changes: 2 additions & 2 deletions sqlmodel/ext/asyncio/session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Mapping, Optional, Sequence, TypeVar, Union
from typing import Any, Mapping, Optional, Sequence, TypeVar, Union, Tuple

from sqlalchemy import util
from sqlalchemy.ext.asyncio import AsyncSession as _AsyncSession
Expand All @@ -11,7 +11,7 @@
from ...orm.session import Session
from ...sql.expression import Select

_T = TypeVar("_T")
_T = TypeVar("_T", bound=Tuple[Any, ...])


class AsyncSession(_AsyncSession):
Expand Down
2 changes: 1 addition & 1 deletion sqlmodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pydantic.fields import FieldInfo as PydanticFieldInfo
from pydantic.fields import ModelField, Undefined, UndefinedType
from pydantic.main import ModelMetaclass, validate_model
from pydantic.typing import ForwardRef, NoArgAnyCallable, resolve_annotations
from pydantic.typing import ForwardRef, NoArgAnyCallable, resolve_annotations # type: ignore
from pydantic.utils import ROOT_KEY, Representation
from sqlalchemy import Boolean, Column, Date, DateTime
from sqlalchemy import Enum as sa_Enum
Expand Down
4 changes: 2 additions & 2 deletions sqlmodel/orm/session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Mapping, Optional, Sequence, Type, TypeVar, Union, overload
from typing import Any, Mapping, Optional, Sequence, Type, TypeVar, Union, overload, Tuple

from sqlalchemy import util
from sqlalchemy.orm import Query as _Query
Expand All @@ -10,7 +10,7 @@
from ..engine.result import Result, ScalarResult
from ..sql.base import Executable

_TSelectParam = TypeVar("_TSelectParam")
_TSelectParam = TypeVar("_TSelectParam", bound=Tuple[Any, ...])


class Session(_Session):
Expand Down
2 changes: 1 addition & 1 deletion sqlmodel/sql/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from sqlalchemy.sql.elements import ColumnClause
from sqlalchemy.sql.expression import Select as _Select

_TSelect = TypeVar("_TSelect")
_TSelect = TypeVar("_TSelect", bound=Tuple[Any, ...])


class Select(_Select[_TSelect], Generic[_TSelect]):
Expand Down

0 comments on commit 9266acb

Please sign in to comment.