]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix annotations
authorMehdi Gmira <mgmira@wiremind.io>
Mon, 7 Aug 2023 14:50:39 +0000 (10:50 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Aug 2023 22:12:58 +0000 (18:12 -0400)
commit0661cd99c4e06115d3dd8318a6bda5e2b41d11ae
treee1baa6eea614bc2392fc89924f9768cdaca28431
parent1377f33075a0e4230c88506d2bfd1e847a336da5
Fix annotations

Typing improvements:

* :class:`.CursorResult` is returned for some forms of
:meth:`_orm.Session.execute` where DML without RETURNING is used
* fixed type for :paramref:`_orm.Query.with_for_update.of` parameter within
:meth:`_orm.Query.with_for_update`
* improvements to ``_DMLColumnArgument`` type used by some DML methods to
pass column expressions
* Add overload to :func:`_sql.literal` so that it is inferred that the
return type is ``BindParameter[NullType]`` where
:paramref:`_sql.literal.type_` param is None
* Add overloads to :meth:`_sql.ColumnElement.op` so that the inferred
type when :paramref:`_sql.ColumnElement.op.return_type` is not provided
is ``Callable[[Any], BinaryExpression[Any]]``
* Add missing overload to :meth:`_sql.ColumnElement.__add__`

Pull request courtesy Mehdi Gmira.

Fixes: #9185
Closes: #10108
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10108
Pull-request-sha: 6017526c9cd1282025885cb002de1f984f64205b

Change-Id: I77a2a199b7a8b137b405001bef8813cf2d327bca
doc/build/changelog/unreleased_20/9185.rst [new file with mode: 0644]
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/asyncio/session.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/scoping.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/sql/_typing.py
lib/sqlalchemy/sql/elements.py
test/typing/plain_files/orm/typed_queries.py
test/typing/plain_files/sql/common_sql_element.py
test/typing/plain_files/sql/operators.py