Skip to content

Commit 6099ec2

Browse files
committed
Fix PostgreSQL array type
Fixes dropbox#188. Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 55470ce commit 6099ec2

File tree

1 file changed

+10
-3
lines changed
  • sqlalchemy-stubs/dialects/postgresql

1 file changed

+10
-3
lines changed

sqlalchemy-stubs/dialects/postgresql/array.pyi

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from typing import Any as _AnyType, Optional, TypeVar, Type, Callable, overload
2-
from ...sql import expression
1+
from typing import Any as _AnyType, Optional, Sequence, TypeVar, Type, Union, Callable, overload
2+
from ...sql import ColumnElement, expression
33
from ...sql.type_api import TypeEngine
44
from ... import types as _sqltypes
55

@@ -8,7 +8,14 @@ _T = TypeVar('_T')
88
def Any(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ...
99
def All(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ...
1010

11-
class array(expression.Tuple): ...
11+
class array(expression.Tuple[_T]):
12+
def __init__(
13+
self,
14+
clauses: Sequence[Union[_T, ColumnElement[_T]]],
15+
type_: Optional[Union[TypeEngine[_T], Type[TypeEngine[_T]]]] = None,
16+
**kw: Any,
17+
) -> None: ...
18+
1219
class ARRAY(_sqltypes.ARRAY[_T]):
1320
@overload
1421
def __init__(self, item_type: TypeEngine[_T], as_tuple: bool = ..., dimensions: Optional[_AnyType] = ...,

0 commit comments

Comments
 (0)