From 49f8ec4bcbaf7b1fa65eb69073d15dba76562cc9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 5 Mar 2023 19:54:30 -0500 Subject: [PATCH] (lots of) changelog updates for 2.0.5 Change-Id: Iea2ca2cd1eb44b4e9139f2bb6c3d6239f67aeb56 --- doc/build/changelog/changelog_20.rst | 2 +- doc/build/changelog/unreleased_20/5648.rst | 2 +- doc/build/changelog/unreleased_20/8853.rst | 8 ++++---- doc/build/changelog/unreleased_20/9343.rst | 2 +- doc/build/changelog/unreleased_20/9349.rst | 9 +++++---- doc/build/changelog/unreleased_20/9367.rst | 13 +++++++------ doc/build/changelog/unreleased_20/9376.rst | 8 ++++---- doc/build/changelog/unreleased_20/9379.rst | 8 +++++--- doc/build/changelog/unreleased_20/9391.rst | 7 ++++--- doc/build/changelog/unreleased_20/9401.rst | 7 +++++-- doc/build/changelog/unreleased_20/9423.rst | 4 ++-- .../unreleased_20/metadata_schema.rst | 4 ++-- lib/sqlalchemy/engine/events.py | 19 +++++++++++++++++++ 13 files changed, 60 insertions(+), 33 deletions(-) diff --git a/doc/build/changelog/changelog_20.rst b/doc/build/changelog/changelog_20.rst index eeee375b8f..9c430bfe0e 100644 --- a/doc/build/changelog/changelog_20.rst +++ b/doc/build/changelog/changelog_20.rst @@ -217,7 +217,7 @@ lost. .. change:: - :tags: bug, orm, regression + :tags: bug, orm, ression :tickets: 9232 Fixed obscure ORM inheritance issue caused by :ticket:`8705` where some diff --git a/doc/build/changelog/unreleased_20/5648.rst b/doc/build/changelog/unreleased_20/5648.rst index acc1251b11..84539ecd30 100644 --- a/doc/build/changelog/unreleased_20/5648.rst +++ b/doc/build/changelog/unreleased_20/5648.rst @@ -3,7 +3,7 @@ :tickets: 5648 The support for pool ping listeners to receive exception events via the - :meth:`.ConnectionEvents.handle_error` event added in 2.0.0b1 for + :meth:`.DialectEvents.handle_error` event added in 2.0.0b1 for :ticket:`5648` failed to take into account dialect-specific ping routines such as that of MySQL and PostgreSQL. The dialect feature has been reworked so that all dialects participate within event handling. Additionally, diff --git a/doc/build/changelog/unreleased_20/8853.rst b/doc/build/changelog/unreleased_20/8853.rst index a10ec43a66..fd07869737 100644 --- a/doc/build/changelog/unreleased_20/8853.rst +++ b/doc/build/changelog/unreleased_20/8853.rst @@ -6,7 +6,7 @@ name to be fully qualified regardless of whether or not ``from __annotations__ import future`` were present. This issue first fixed in 2.0.0b3 confirmed that this case worked via the test suite, however the - test suite apparently was not testing the behavior for the name ``Mapped`` - not being locally present at all; string resolution has been updated to - ensure the ``Mapped`` symbol is locatable as applies to how the ORM uses - these functions. + test suite apparently was not testing the behavior for the name + :class:`_orm.Mapped` not being locally present at all; string resolution + has been updated to ensure the :class:`_orm.Mapped` symbol is locatable as + applies to how the ORM uses these functions. diff --git a/doc/build/changelog/unreleased_20/9343.rst b/doc/build/changelog/unreleased_20/9343.rst index f6cf95e13c..8c82ec1fa9 100644 --- a/doc/build/changelog/unreleased_20/9343.rst +++ b/doc/build/changelog/unreleased_20/9343.rst @@ -2,7 +2,7 @@ :tags: engine, performance :tickets: 9343 - A small optimization to the Cython implementation of :class:`.ResultProxy` + A small optimization to the Cython implementation of :class:`.Result` using a cdef for a particular int value to avoid Python overhead. Pull request courtesy Matus Valo. diff --git a/doc/build/changelog/unreleased_20/9349.rst b/doc/build/changelog/unreleased_20/9349.rst index 957ac56871..7e708f3798 100644 --- a/doc/build/changelog/unreleased_20/9349.rst +++ b/doc/build/changelog/unreleased_20/9349.rst @@ -1,6 +1,7 @@ .. change:: - :tags: bug, schema, postgresql - :tickets: 9332 + :tags: bug, postgresql + :tickets: 9349 - ExcludeConstraint correctly uses literal compile when compiling - expression ddl. + Fixed issue in PostgreSQL :class:`_postgresql.ExcludeConstraint` where + literal values were being compiled as bound parameters and not direct + inline values as is required for DDL. diff --git a/doc/build/changelog/unreleased_20/9367.rst b/doc/build/changelog/unreleased_20/9367.rst index 9355ffdead..883e5a215d 100644 --- a/doc/build/changelog/unreleased_20/9367.rst +++ b/doc/build/changelog/unreleased_20/9367.rst @@ -2,10 +2,11 @@ :tags: bug, ext :tickets: 9367 - Fixed issue in automap where calling ``.prepare()`` from one of the mapped - classes would not use the correct base class when automap detected new - tables, instead using the given class, leading to mappers trying to - configure inheritance. While one should normally call ``.prepare()`` from - the base in any case, it shouldn't misbehave that badly when called from a - subclass. + Fixed issue in automap where calling :meth:`_automap.AutomapBase.prepare` + from a specific mapped class, rather than from the + :class:`_automap.AutomapBase` directly, would not use the correct base + class when automap detected new tables, instead using the given class, + leading to mappers trying to configure inheritance. While one should + normally call :meth:`_automap.AutomapBase.prepare` from the base in any + case, it shouldn't misbehave that badly when called from a subclass. diff --git a/doc/build/changelog/unreleased_20/9376.rst b/doc/build/changelog/unreleased_20/9376.rst index 6d63d09d42..1bec16485d 100644 --- a/doc/build/changelog/unreleased_20/9376.rst +++ b/doc/build/changelog/unreleased_20/9376.rst @@ -2,7 +2,7 @@ :tags: bug, typing :tickets: 9376 - Improved typing for the mapping passed to :meth:`.UpdateBase.values` to be - more open-ended about collection type, by indicating read-only ``Mapping`` - instead of writeable ``Dict`` which would error out on too limited of a key - type. + Improved typing for the mapping passed to :meth:`.Insert.values` and + :meth:`.Update.values` to be more open-ended about collection type, by + indicating read-only ``Mapping`` instead of writeable ``Dict`` which would + error out on too limited of a key type. diff --git a/doc/build/changelog/unreleased_20/9379.rst b/doc/build/changelog/unreleased_20/9379.rst index 97e9b6c9bd..9784639df9 100644 --- a/doc/build/changelog/unreleased_20/9379.rst +++ b/doc/build/changelog/unreleased_20/9379.rst @@ -1,6 +1,8 @@ .. change:: - :tags: bug, sqlite + :tags: bug, sqlite, regression :tickets: 9379 - Fixed bug that prevented SQLAlchemy to connect when using a very old - sqlite version (before 3.8.3) on python 3.8+. + Fixed regression for SQLite connections where use of the ``deterministic`` + parameter when establishing database functions would fail for older SQLite + versions, those prior to version 3.8.3. The version checking logic has been + improved to accommodate for this case. diff --git a/doc/build/changelog/unreleased_20/9391.rst b/doc/build/changelog/unreleased_20/9391.rst index 99336a71c7..33c42f2654 100644 --- a/doc/build/changelog/unreleased_20/9391.rst +++ b/doc/build/changelog/unreleased_20/9391.rst @@ -2,6 +2,7 @@ :tags: bug, typing :tickets: 9391 - Added missing init overload to :class:`_sql.Numeric` to allow - type checkers to properly resolve the type var given the - ``asdecimal`` parameter. + Added missing init overload to the :class:`_types.Numeric` type object so + that pep-484 type checkers may properly resolve the complete type, deriving + from the :paramref:`_types.Numeric.asdecimal` parameter whether ``Decimal`` + or ``float`` objects will be represented. diff --git a/doc/build/changelog/unreleased_20/9401.rst b/doc/build/changelog/unreleased_20/9401.rst index 48d88f56bf..50232959b0 100644 --- a/doc/build/changelog/unreleased_20/9401.rst +++ b/doc/build/changelog/unreleased_20/9401.rst @@ -1,5 +1,8 @@ .. change:: - :tags: bug, schema, postgresql + :tags: bug, postgresql :tickets: 9401 - Fixed issue when copying ExcludeConstraint. + Fixed issue where the PostgreSQL :class:`_postgresql.ExcludeConstraint` + construct would not be copyable within operations such as + :meth:`_schema.Table.to_metadata` as well as within some Alembic scenarios, + if the constraint contained textual expression elements. diff --git a/doc/build/changelog/unreleased_20/9423.rst b/doc/build/changelog/unreleased_20/9423.rst index ddb6f9f4f7..84dc5cb3d1 100644 --- a/doc/build/changelog/unreleased_20/9423.rst +++ b/doc/build/changelog/unreleased_20/9423.rst @@ -2,5 +2,5 @@ :tags: bug, engine :tickets: 9423 - Fixed bug where :meth:`_engine.Row`s could not be - unpickled by other processes. + Fixed bug where :class:`_engine.Row` objects could not be reliably unpickled + across processes due to an accidental reliance on an unstable hash value. diff --git a/doc/build/changelog/unreleased_20/metadata_schema.rst b/doc/build/changelog/unreleased_20/metadata_schema.rst index 88664d1cb0..fdb8409650 100644 --- a/doc/build/changelog/unreleased_20/metadata_schema.rst +++ b/doc/build/changelog/unreleased_20/metadata_schema.rst @@ -1,5 +1,5 @@ .. change:: :tags: schema - Validate that when provided the :paramref:`_sql.MetaData.schema` - argument of :class:`_sql.MetaData` is a string. + Validate that when provided the :paramref:`_schema.MetaData.schema` + argument of :class:`_schema.MetaData` is a string. diff --git a/lib/sqlalchemy/engine/events.py b/lib/sqlalchemy/engine/events.py index b906389a90..9028c8c331 100644 --- a/lib/sqlalchemy/engine/events.py +++ b/lib/sqlalchemy/engine/events.py @@ -744,6 +744,25 @@ class DialectEvents(event.Events[Dialect]): make use of a native ``ping()`` method supplied by the DBAPI which does not make use of disconnect codes. + .. versionchanged:: 2.0.0 The :meth:`.DialectEvents.handle_error` + event hook participates in connection pool "pre-ping" operations. + Within this usage, the :attr:`.ExceptionContext.engine` attribute + will be ``None``, however the :class:`.Dialect` in use is always + available via the :attr:`.ExceptionContext.dialect` attribute. + + .. versionchanged:: 2.0.5 Added :attr:`.ExceptionContext.is_pre_ping` + attribute which will be set to ``True`` when the + :meth:`.DialectEvents.handle_error` event hook is triggered within + a connection pool pre-ping operation. + + .. versionchanged:: 2.0.5 An issue was repaired that allows for the + PostgreSQL ``psycopg`` and ``psycopg2`` drivers, as well as all + MySQL drivers, to properly participate in the + :meth:`.DialectEvents.handle_error` event hook during + connection pool "pre-ping" operations; previously, the + implementation was non-working for these drivers. + + A handler function has two options for replacing the SQLAlchemy-constructed exception into one that is user defined. It can either raise this new exception directly, in -- 2.47.2