Skip to content

Commit d6cf578

Browse files
authored
Fix couple stub issues (#128)
1 parent ea93332 commit d6cf578

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

sqlalchemy-stubs/engine/base.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Dict, Union
1+
from typing import Any, Optional, Dict, Union, Text
22
from sqlalchemy import log
33
from sqlalchemy.sql.expression import ClauseElement
44
from sqlalchemy.sql.functions import FunctionElement
@@ -103,7 +103,7 @@ class Engine(Connectable, log.Identified):
103103
def transaction(self, callable_, *args, **kwargs): ...
104104
def run_callable(self, callable_, *args, **kwargs): ...
105105
def execute(self,
106-
object: Union[str, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled],
106+
object: Union[Text, ClauseElement, FunctionElement, DDLElement, DefaultGenerator, Compiled],
107107
*multiparams: Any,
108108
**params: Any) -> ResultProxy: ...
109109
def scalar(self, statement, *multiparams, **params): ...

sqlalchemy-stubs/sql/operators.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Text, List, Union
1+
from typing import Any, Iterable, Optional, Text, Union
22
from .selectable import Select as Select
33
from .elements import BindParameter as BindParameter, UnaryExpression
44

@@ -42,8 +42,8 @@ class ColumnOperators(Operators):
4242
def concat(self, other): ...
4343
def like(self, other: Text, escape: Optional[Any] = ...): ...
4444
def ilike(self, other: Text, escape: Optional[Any] = ...): ...
45-
def in_(self, other: Union[List[Any], BindParameter, Select]): ...
46-
def notin_(self, other: Union[List[Any], BindParameter, Select]): ...
45+
def in_(self, other: Union[Iterable[Any], BindParameter, Select]): ...
46+
def notin_(self, other: Union[Iterable[Any], BindParameter, Select]): ...
4747
def notlike(self, other, escape: Optional[Any] = ...): ...
4848
def notilike(self, other, escape: Optional[Any] = ...): ...
4949
def is_(self, other): ...

sqlalchemy-stubs/sql/schema.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from typing import (
2-
Any, Optional, Union, Set, Generic, TypeVar, Type, List, Dict, Tuple, Set, Sequence as SequenceType, Mapping,
2+
Any, Optional, Union, Generic, TypeVar, Type, List, Tuple, Set, Sequence as SequenceType, Mapping,
33
Callable, Iterable, Iterator, overload
44
)
55
from . import visitors, functions
66
from .base import SchemaEventTarget as SchemaEventTarget, DialectKWArgs as DialectKWArgs, ColumnCollection
7-
from .elements import ColumnClause as ColumnClause, TextClause
7+
from .elements import ColumnClause as ColumnClause, TextClause, ColumnElement
88
from .selectable import TableClause as TableClause
99
from .type_api import TypeEngine
1010
from .. import util
@@ -304,7 +304,7 @@ class Index(DialectKWArgs, ColumnCollectionMixin, SchemaItem):
304304
name: str = ...
305305
unique: bool = ...
306306
info: Optional[Mapping[str, Any]] = ...
307-
def __init__(self, name: str, *expressions: Union[TextClause, Column[Any], str], unique: bool = ...,
307+
def __init__(self, name: str, *expressions: Union[TextClause, ColumnElement[Any], str], unique: bool = ...,
308308
quote: Optional[bool] = ..., info: Optional[Mapping[str, Any]] = ..., **kw: Any) -> None: ...
309309
@property
310310
def bind(self) -> Optional[Union[Engine, Connection]]: ...

0 commit comments

Comments
 (0)