Skip to content

Commit 53e7a90

Browse files
committed
Updates based on PR feedback
1 parent b515784 commit 53e7a90

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

sqlalchemy-stubs/sql/sqltypes.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ from decimal import Decimal
66
from typing import Any
77
from typing import List
88
from typing import Mapping
9+
from typing import NoReturn
910
from typing import Optional
1011
from typing import Type
1112
from typing import TypeVar
@@ -328,7 +329,7 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine[List]):
328329
class TupleType(TypeEngine[TupleType]):
329330
types: Any = ...
330331
def __init__(self, *types: Any) -> None: ...
331-
def result_processor(self, dialect: Any, coltype: Any) -> None: ...
332+
def result_processor(self, dialect: Any, coltype: Any) -> NoReturn: ...
332333

333334
class REAL(Float):
334335
__visit_name__: str = ...

sqlalchemy-stubs/sql/type_api.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class TypeEngine(Traversible, Generic[_T]):
5656
self, dialect: Any, conn_type: Any
5757
) -> Any: ...
5858
def copy_value(self, value: _T) -> _T: ...
59-
def literal_processor(self, dialect: Any) -> Optional[Callable[..., Any]]: ...
60-
def bind_processor(self, dialect: Any) -> Optional[Callable[..., Any]]: ...
61-
def result_processor(self, dialect: Any, coltype: Any) -> Optional[Callable[..., Any]]: ...
59+
def literal_processor(self, dialect: Any) -> Optional[Callable[[Optional[_T]], str]]: ...
60+
def bind_processor(self, dialect: Any) -> Optional[Callable[[Optional[_T]], Optional[Any]]]: ...
61+
def result_processor(self, dialect: Any, coltype: Any) -> Optional[Callable[[Optional[Any]], Optional[_T]]]: ...
6262
def column_expression(self, colexpr: Any) -> Any: ...
6363
def bind_expression(self, bindvalue: Any) -> Any: ...
6464
def compare_values(self, x: Any, y: Any) -> bool: ...
@@ -102,11 +102,11 @@ class TypeDecorator(SchemaEventTarget, TypeEngine[_T]):
102102
def type_engine(self, dialect: Any) -> TypeEngine[Any]: ...
103103
def load_dialect_impl(self, dialect: Any) -> TypeEngine[Any]: ...
104104
def __getattr__(self, key: Any) -> Any: ...
105-
def process_literal_param(self, value: Any, dialect: Any) -> Optional[str]: ...
106-
def process_bind_param(self, value: Any, dialect: Any) -> Optional[Text]: ...
105+
def process_literal_param(self, value: Optional[_T], dialect: Any) -> str: ...
106+
def process_bind_param(self, value: Optional[_T], dialect: Any) -> Any: ...
107107
def process_result_value(self, value: Any, dialect: Any) -> Optional[_T]: ...
108-
def literal_processor(self, dialect: Any) -> Callable[[Optional[_T]], Optional[str]]: ...
109-
def bind_processor(self, dialect: Any) -> Callable[[Optional[_T]], Optional[str]]: ...
108+
def literal_processor(self, dialect: Any) -> Callable[[Optional[_T]], str]: ...
109+
def bind_processor(self, dialect: Any) -> Callable[[Optional[_T]], Optional[Any]]: ...
110110
def result_processor(self, dialect: Any, coltype: Any) -> Callable[[Optional[Any]], Optional[_T]]: ...
111111
def bind_expression(self, bindparam: Any) -> Any: ...
112112
def column_expression(self, column: Any) -> Any: ...
@@ -118,7 +118,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine[_T]):
118118
def sort_key_function(self) -> Optional[_SortKeyFunction]: ... # type: ignore[override]
119119

120120
class Variant(TypeDecorator[_T]):
121-
impl: Type[TypeEngine[Any]] = ...
121+
impl: TypeEngine[Any] = ...
122122
mapping: Mapping[str, TypeEngine[Any]] = ...
123123
def __init__(self, base: Any, mapping: Mapping[str, TypeEngine[Any]]) -> None: ...
124124
def coerce_compared_value(self: _VT, operator: Any, value: Any) -> Union[_VT, TypeEngine[Any]]: ...

0 commit comments

Comments
 (0)