From: Mike Bayer Date: Wed, 19 Jan 2022 23:18:12 +0000 (-0500) Subject: cherry-pick changelog from 1.4.30 X-Git-Tag: rel_2_0_0b1~532 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96804aed1231b2451698d3b29fff4532cedb7f45;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git cherry-pick changelog from 1.4.30 --- diff --git a/doc/build/changelog/changelog_14.rst b/doc/build/changelog/changelog_14.rst index 635f996383..4ffe17a3d6 100644 --- a/doc/build/changelog/changelog_14.rst +++ b/doc/build/changelog/changelog_14.rst @@ -15,7 +15,192 @@ This document details individual issue-level changes made throughout .. changelog:: :version: 1.4.30 - :include_notes_from: unreleased_14 + :released: January 19, 2022 + + .. change:: + :tags: usecase, asyncio + :tickets: 7580 + + Added new method :meth:`.AdaptedConnection.run_async` to the DBAPI + connection interface used by asyncio drivers, which allows methods to be + called against the underlying "driver" connection directly within a + sync-style function where the ``await`` keyword can't be used, such as + within SQLAlchemy event handler functions. The method is analogous to the + :meth:`_asyncio.AsyncConnection.run_sync` method which translates + async-style calls to sync-style. The method is useful for things like + connection-pool on-connect handlers that need to invoke awaitable methods + on the driver connection when it's first created. + + .. seealso:: + + :ref:`asyncio_events_run_async` + + + .. change:: + :tags: bug, orm + :tickets: 7507 + + Fixed issue in joined-inheritance load of additional attributes + functionality in deep multi-level inheritance where an intermediary table + that contained no columns would not be included in the tables joined, + instead linking those tables to their primary key identifiers. While this + works fine, it nonetheless in 1.4 began producing the cartesian product + compiler warning. The logic has been changed so that these intermediary + tables are included regardless. While this does include additional tables + in the query that are not technically necessary, this only occurs for the + highly unusual case of deep 3+ level inheritance with intermediary tables + that have no non primary key columns, potential performance impact is + therefore expected to be negligible. + + .. change:: + :tags: bug, orm + :tickets: 7579 + + Fixed issue where calling upon :meth:`_orm.registry.map_imperatively` more + than once for the same class would produce an unexpected error, rather than + an informative error that the target class is already mapped. This behavior + differed from that of the :func:`_orm.mapper` function which does report an + informative message already. + + .. change:: + :tags: bug, sql, postgresql + :tickets: 7537 + + Added additional rule to the system that determines ``TypeEngine`` + implementations from Python literals to apply a second level of adjustment + to the type, so that a Python datetime with or without tzinfo can set the + ``timezone=True`` parameter on the returned :class:`.DateTime` object, as + well as :class:`.Time`. This helps with some round-trip scenarios on + type-sensitive PostgreSQL dialects such as asyncpg, psycopg3 (2.0 only). + + .. change:: + :tags: bug, postgresql, asyncpg + :tickets: 7537 + + Improved support for asyncpg handling of TIME WITH TIMEZONE, which + was not fully implemented. + + .. change:: + :tags: usecase, postgresql + :tickets: 7561 + + Added string rendering to the :class:`.postgresql.UUID` datatype, so that + stringifying a statement with "literal_binds" that uses this type will + render an appropriate string value for the PostgreSQL backend. Pull request + courtesy José Duarte. + + .. change:: + :tags: bug, orm, asyncio + :tickets: 7524 + + Added missing method :meth:`_asyncio.AsyncSession.invalidate` to the + :class:`_asyncio.AsyncSession` class. + + + .. change:: + :tags: bug, orm, regression + :tickets: 7557 + + Fixed regression which appeared in 1.4.23 which could cause loader options + to be mis-handled in some cases, in particular when using joined table + inheritance in combination with the ``polymorphic_load="selectin"`` option + as well as relationship lazy loading, leading to a ``TypeError``. + + + .. change:: + :tags: bug, mypy + :tickets: 7321 + + Fixed Mypy crash when running id daemon mode caused by a + missing attribute on an internal mypy ``Var`` instance. + + .. change:: + :tags: change, mysql + :tickets: 7518 + + Replace ``SHOW VARIABLES LIKE`` statement with equivalent + ``SELECT @@variable`` in MySQL and MariaDB dialect initialization. + This should avoid mutex contention caused by ``SHOW VARIABLES``, + improving initialization performance. + + .. change:: + :tags: bug, orm, regression + :tickets: 7576 + + Fixed ORM regression where calling the :func:`_orm.aliased` function + against an existing :func:`_orm.aliased` construct would fail to produce + correct SQL if the existing construct were against a fixed table. The fix + allows that the original :func:`_orm.aliased` construct is disregarded if + it were only against a table that's now being replaced. It also allows for + correct behavior when constructing a :func:`_orm.aliased` without a + selectable argument against a :func:`_orm.aliased` that's against a + subuquery, to create an alias of that subquery (i.e. to change its name). + + The nesting behavior of :func:`_orm.aliased` remains in place for the case + where the outer :func:`_orm.aliased` object is against a subquery which in + turn refers to the inner :func:`_orm.aliased` object. This is a relatively + new 1.4 feature that helps to suit use cases that were previously served by + the deprecated ``Query.from_self()`` method. + + .. change:: + :tags: bug, orm + :tickets: 7514 + + Fixed issue where :meth:`_sql.Select.correlate_except` method, when passed + either the ``None`` value or no arguments, would not correlate any elements + when used in an ORM context (that is, passing ORM entities as FROM + clauses), rather than causing all FROM elements to be considered as + "correlated" in the same way which occurs when using Core-only constructs. + + .. change:: + :tags: bug, orm, regression + :tickets: 7505 + + Fixed regression from 1.3 where the "subqueryload" loader strategy would + fail with a stack trace if used against a query that made use of + :meth:`_orm.Query.from_statement` or :meth:`_sql.Select.from_statement`. As + subqueryload requires modifying the original statement, it's not compatible + with the "from_statement" use case, especially for statements made against + the :func:`_sql.text` construct. The behavior now is equivalent to that of + 1.3 and previously, which is that the loader strategy silently degrades to + not be used for such statements, typically falling back to using the + lazyload strategy. + + + .. change:: + :tags: bug, reflection, postgresql, mssql + :tickets: 7382 + + Fixed reflection of covering indexes to report ``include_columns`` as part + of the ``dialect_options`` entry in the reflected index dictionary, thereby + enabling round trips from reflection->create to be complete. Included + columns continue to also be present under the ``include_columns`` key for + backwards compatibility. + + .. change:: + :tags: bug, mysql + :tickets: 7567 + + Removed unnecessary dependency on PyMySQL from the asyncmy dialect. Pull + request courtesy long2ice. + + + .. change:: + :tags: bug, postgresql + :tickets: 7418 + + Fixed handling of array of enum values which require escape characters. + + .. change:: + :tags: bug, sql + :tickets: 7032 + + Added an informative error message when a method object is passed to a SQL + construct. Previously, when such a callable were passed, as is a common + typographical error when dealing with method-chained SQL constructs, they + were interpreted as "lambda SQL" targets to be invoked at compilation time, + which would lead to silent failures. As this feature was not intended to be + used with methods, method objects are now rejected. .. changelog:: :version: 1.4.29 diff --git a/doc/build/changelog/unreleased_14/7032.rst b/doc/build/changelog/unreleased_14/7032.rst deleted file mode 100644 index c837be4944..0000000000 --- a/doc/build/changelog/unreleased_14/7032.rst +++ /dev/null @@ -1,10 +0,0 @@ -.. change:: - :tags: bug, sql - :tickets: 7032 - - Added an informative error message when a method object is passed to a SQL - construct. Previously, when such a callable were passed, as is a common - typographical error when dealing with method-chained SQL constructs, they - were interpreted as "lambda SQL" targets to be invoked at compilation time, - which would lead to silent failures. As this feature was not intended to be - used with methods, method objects are now rejected. diff --git a/doc/build/changelog/unreleased_14/7347.rst b/doc/build/changelog/unreleased_14/7347.rst deleted file mode 100644 index f259112fd9..0000000000 --- a/doc/build/changelog/unreleased_14/7347.rst +++ /dev/null @@ -1,6 +0,0 @@ -.. change:: - :tags: bug, mypy - :tickets: 7321 - - Fixed Mypy crash when running id daemon mode caused by a - missing attribute on an internal mypy ``Var`` instance. diff --git a/doc/build/changelog/unreleased_14/7382.rst b/doc/build/changelog/unreleased_14/7382.rst deleted file mode 100644 index db6ae45311..0000000000 --- a/doc/build/changelog/unreleased_14/7382.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, reflection, postgresql, mssql - :tickets: 7382 - - Fixed reflection of covering indexes to report ``include_columns`` as part - of the ``dialect_options`` entry in the reflected index dictionary, thereby - enabling round trips from reflection->create to be complete. Included - columns continue to also be present under the ``include_columns`` key for - backwards compatibility. diff --git a/doc/build/changelog/unreleased_14/7418.rst b/doc/build/changelog/unreleased_14/7418.rst deleted file mode 100644 index e1e192571d..0000000000 --- a/doc/build/changelog/unreleased_14/7418.rst +++ /dev/null @@ -1,5 +0,0 @@ -.. change:: - :tags: bug, postgresql - :tickets: 7418 - - Fixed handling of array of enum values which require escape characters. diff --git a/doc/build/changelog/unreleased_14/7505.rst b/doc/build/changelog/unreleased_14/7505.rst deleted file mode 100644 index b017c0ae13..0000000000 --- a/doc/build/changelog/unreleased_14/7505.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. change:: - :tags: bug, orm, regression - :tickets: 7505 - - Fixed regression from 1.3 where the "subqueryload" loader strategy would - fail with a stack trace if used against a query that made use of - :meth:`_orm.Query.from_statement` or :meth:`_sql.Select.from_statement`. As - subqueryload requires modifying the original statement, it's not compatible - with the "from_statement" use case, especially for statements made against - the :func:`_sql.text` construct. The behavior now is equivalent to that of - 1.3 and previously, which is that the loader strategy silently degrades to - not be used for such statements, typically falling back to using the - lazyload strategy. - diff --git a/doc/build/changelog/unreleased_14/7507.rst b/doc/build/changelog/unreleased_14/7507.rst deleted file mode 100644 index 7412c7f0ce..0000000000 --- a/doc/build/changelog/unreleased_14/7507.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 7507 - - Fixed issue in joined-inheritance load of additional attributes - functionality in deep multi-level inheritance where an intermediary table - that contained no columns would not be included in the tables joined, - instead linking those tables to their primary key identifiers. While this - works fine, it nonetheless in 1.4 began producing the cartesian product - compiler warning. The logic has been changed so that these intermediary - tables are included regardless. While this does include additional tables - in the query that are not technically necessary, this only occurs for the - highly unusual case of deep 3+ level inheritance with intermediary tables - that have no non primary key columns, potential performance impact is - therefore expected to be negligible. diff --git a/doc/build/changelog/unreleased_14/7514.rst b/doc/build/changelog/unreleased_14/7514.rst deleted file mode 100644 index bf6fd471ee..0000000000 --- a/doc/build/changelog/unreleased_14/7514.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 7514 - - Fixed issue where :meth:`_sql.Select.correlate_except` method, when passed - either the ``None`` value or no arguments, would not correlate any elements - when used in an ORM context (that is, passing ORM entities as FROM - clauses), rather than causing all FROM elements to be considered as - "correlated" in the same way which occurs when using Core-only constructs. diff --git a/doc/build/changelog/unreleased_14/7518.rst b/doc/build/changelog/unreleased_14/7518.rst deleted file mode 100644 index 6264297cb1..0000000000 --- a/doc/build/changelog/unreleased_14/7518.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: change, mysql - :tickets: 7518 - - Replace ``SHOW VARIABLES LIKE`` statement with equivalent - ``SELECT @@variable`` in MySQL and MariaDB dialect initialization. - This should avoid mutex contention caused by ``SHOW VARIABLES``, - improving initialization performance. diff --git a/doc/build/changelog/unreleased_14/7537.rst b/doc/build/changelog/unreleased_14/7537.rst deleted file mode 100644 index d48cf30a07..0000000000 --- a/doc/build/changelog/unreleased_14/7537.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. change:: - :tags: bug, sql, postgresql - :tickets: 7537 - - Added additional rule to the system that determines ``TypeEngine`` - implementations from Python literals to apply a second level of adjustment - to the type, so that a Python datetime with or without tzinfo can set the - ``timezone=True`` parameter on the returned :class:`.DateTime` object, as - well as :class:`.Time`. This helps with some round-trip scenarios on - type-sensitive PostgreSQL dialects such as asyncpg, psycopg3 (2.0 only). - -.. change:: - :tags: bug, postgresql, asyncpg - :tickets: 7537 - - Improved support for asyncpg handling of TIME WITH TIMEZONE, which - was not fully implemented. diff --git a/doc/build/changelog/unreleased_14/7557.rst b/doc/build/changelog/unreleased_14/7557.rst deleted file mode 100644 index b7ccc87cf2..0000000000 --- a/doc/build/changelog/unreleased_14/7557.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, orm, regression - :tickets: 7557 - - Fixed regression which appeared in 1.4.23 which could cause loader options - to be mis-handled in some cases, in particular when using joined table - inheritance in combination with the ``polymorphic_load="selectin"`` option - as well as relationship lazy loading, leading to a ``TypeError``. - diff --git a/doc/build/changelog/unreleased_14/7561.rst b/doc/build/changelog/unreleased_14/7561.rst deleted file mode 100644 index 18ea110631..0000000000 --- a/doc/build/changelog/unreleased_14/7561.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. change:: - :tags: usecase, postgresql - :tickets: 7561 - - Added string rendering to the :class:`.postgresql.UUID` datatype, so that - stringifying a statement with "literal_binds" that uses this type will - render an appropriate string value for the PostgreSQL backend. Pull request - courtesy José Duarte. diff --git a/doc/build/changelog/unreleased_14/7567.rst b/doc/build/changelog/unreleased_14/7567.rst deleted file mode 100644 index 38fa6f39a1..0000000000 --- a/doc/build/changelog/unreleased_14/7567.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. change:: - :tags: bug, mysql - :tickets: 7567 - - Removed unnecessary dependency on PyMySQL from the asyncmy dialect. Pull - request courtesy long2ice. - diff --git a/doc/build/changelog/unreleased_14/7576.rst b/doc/build/changelog/unreleased_14/7576.rst deleted file mode 100644 index 74d8ac4942..0000000000 --- a/doc/build/changelog/unreleased_14/7576.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. change:: - :tags: bug, orm, regression - :tickets: 7576 - - Fixed ORM regression where calling the :func:`_orm.aliased` function - against an existing :func:`_orm.aliased` construct would fail to produce - correct SQL if the existing construct were against a fixed table. The fix - allows that the original :func:`_orm.aliased` construct is disregarded if - it were only against a table that's now being replaced. It also allows for - correct behavior when constructing a :func:`_orm.aliased` without a - selectable argument against a :func:`_orm.aliased` that's against a - subuquery, to create an alias of that subquery (i.e. to change its name). - - The nesting behavior of :func:`_orm.aliased` remains in place for the case - where the outer :func:`_orm.aliased` object is against a subquery which in - turn refers to the inner :func:`_orm.aliased` object. This is a relatively - new 1.4 feature that helps to suit use cases that were previously served by - the deprecated ``Query.from_self()`` method. diff --git a/doc/build/changelog/unreleased_14/7579.rst b/doc/build/changelog/unreleased_14/7579.rst deleted file mode 100644 index 01eea6dacf..0000000000 --- a/doc/build/changelog/unreleased_14/7579.rst +++ /dev/null @@ -1,9 +0,0 @@ -.. change:: - :tags: bug, orm - :tickets: 7579 - - Fixed issue where calling upon :meth:`_orm.registry.map_imperatively` more - than once for the same class would produce an unexpected error, rather than - an informative error that the target class is already mapped. This behavior - differed from that of the :func:`_orm.mapper` function which does report an - informative message already. diff --git a/doc/build/changelog/unreleased_14/7580.rst b/doc/build/changelog/unreleased_14/7580.rst deleted file mode 100644 index fa02085b2b..0000000000 --- a/doc/build/changelog/unreleased_14/7580.rst +++ /dev/null @@ -1,18 +0,0 @@ -.. change:: - :tags: usecase, asyncio - :tickets: 7580 - - Added new method :meth:`.AdaptedConnection.run_async` to the DBAPI - connection interface used by asyncio drivers, which allows methods to be - called against the underlying "driver" connection directly within a - sync-style function where the ``await`` keyword can't be used, such as - within SQLAlchemy event handler functions. The method is analogous to the - :meth:`_asyncio.AsyncConnection.run_sync` method which translates - async-style calls to sync-style. The method is useful for things like - connection-pool on-connect handlers that need to invoke awaitable methods - on the driver connection when it's first created. - - .. seealso:: - - :ref:`asyncio_events_run_async` -