Currently, the process_bind_param method on TypeDecorator[_T] has signature:
|
def process_bind_param(self, value: Optional[_T], dialect: Dialect) -> Optional[typing_Text]: ... |
Unfortunately, it looks like this is incorrect: I believe it can return anything that the underlying impl can accept. For instance, in SQLAlchemy's tests there's type decorators that return ints:
class MyNewIntType(types.TypeDecorator):
impl = Integer
def process_bind_param(self, value, dialect):
return value * 10
def process_result_value(self, value, dialect):
return value * 10
def copy(self):
return MyNewIntType()
The process_bind_param return value should probably be loosened to match the Optional[Any] of its inverse operation process_result_value.
|
def process_result_value(self, value: Optional[Any], dialect: Dialect) -> Optional[_T]: ... |
(This probably applies to process_literal_param too.)
Currently, the
process_bind_parammethod onTypeDecorator[_T]has signature:sqlalchemy-stubs/sqlalchemy-stubs/sql/type_api.pyi
Line 95 in 8495c22
Unfortunately, it looks like this is incorrect: I believe it can return anything that the underlying
implcan accept. For instance, in SQLAlchemy's tests there's type decorators that returnints:The
process_bind_paramreturn value should probably be loosened to match theOptional[Any]of its inverse operationprocess_result_value.sqlalchemy-stubs/sqlalchemy-stubs/sql/type_api.pyi
Line 96 in 8495c22
(This probably applies to
process_literal_paramtoo.)