diff --git a/sqlalchemy-stubs/engine/base.pyi b/sqlalchemy-stubs/engine/base.pyi index 0b4d5cd..5f9c1f0 100644 --- a/sqlalchemy-stubs/engine/base.pyi +++ b/sqlalchemy-stubs/engine/base.pyi @@ -1,4 +1,4 @@ -from typing import Any, Optional, Dict, Union +from typing import Any, Optional, Dict, Union, Text from sqlalchemy import log from sqlalchemy.sql.expression import ClauseElement from sqlalchemy.sql.functions import FunctionElement @@ -103,7 +103,7 @@ class Engine(Connectable, log.Identified): def transaction(self, callable_, *args, **kwargs): ... def run_callable(self, callable_, *args, **kwargs): ... def execute(self, - object: Union[str, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled], + object: Union[Text, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled], *multiparams: Any, **params: Any) -> ResultProxy: ... def scalar(self, statement, *multiparams, **params): ... diff --git a/sqlalchemy-stubs/sql/operators.pyi b/sqlalchemy-stubs/sql/operators.pyi index 12ae91e..e888de5 100644 --- a/sqlalchemy-stubs/sql/operators.pyi +++ b/sqlalchemy-stubs/sql/operators.pyi @@ -1,4 +1,4 @@ -from typing import Any, Optional, Text, List, Union +from typing import Any, Iterable, Optional, Text, Union from .selectable import Select as Select from .elements import BindParameter as BindParameter, UnaryExpression @@ -42,8 +42,8 @@ class ColumnOperators(Operators): def concat(self, other): ... def like(self, other: Text, escape: Optional[Any] = ...): ... def ilike(self, other: Text, escape: Optional[Any] = ...): ... - def in_(self, other: Union[List[Any], BindParameter, Select]): ... - def notin_(self, other: Union[List[Any], BindParameter, Select]): ... + def in_(self, other: Union[Iterable[Any], BindParameter, Select]): ... + def notin_(self, other: Union[Iterable[Any], BindParameter, Select]): ... def notlike(self, other, escape: Optional[Any] = ...): ... def notilike(self, other, escape: Optional[Any] = ...): ... def is_(self, other): ... diff --git a/sqlalchemy-stubs/sql/schema.pyi b/sqlalchemy-stubs/sql/schema.pyi index e5141db..758ab4b 100644 --- a/sqlalchemy-stubs/sql/schema.pyi +++ b/sqlalchemy-stubs/sql/schema.pyi @@ -1,10 +1,10 @@ from typing import ( - Any, Optional, Union, Set, Generic, TypeVar, Type, List, Dict, Tuple, Set, Sequence as SequenceType, Mapping, + Any, Optional, Union, Generic, TypeVar, Type, List, Tuple, Set, Sequence as SequenceType, Mapping, Callable, Iterable, Iterator, overload ) from . import visitors, functions from .base import SchemaEventTarget as SchemaEventTarget, DialectKWArgs as DialectKWArgs, ColumnCollection -from .elements import ColumnClause as ColumnClause, TextClause +from .elements import ColumnClause as ColumnClause, TextClause, ColumnElement from .selectable import TableClause as TableClause from .type_api import TypeEngine from .. import util @@ -304,7 +304,7 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem): name: str = ... unique: bool = ... info: Optional[Mapping[str, Any]] = ... - def __init__(self, name: str, *expressions: Union[TextClause, Column[Any], str], unique: bool = ..., + def __init__(self, name: str, *expressions: Union[TextClause, ColumnElement[Any], str], unique: bool = ..., quote: Optional[bool] = ..., info: Optional[Mapping[str, Any]] = ..., **kw: Any) -> None: ... @property def bind(self) -> Optional[Union[Engine, Connection]]: ...