Skip to content

Conversation

@pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Apr 7, 2021

This PR updates SQLAlchemy from 1.4.3 to 1.4.6.

Changelog

1.4.6

:released: April 6, 2021

 .. change::
     :tags: bug, sql, regression, oracle, mssql
     :tickets: 6202

     Fixed further regressions in the same area as that of :ticket:`6173` released in
     1.4.5, where a "postcompile" parameter, again most typically those used for
     LIMIT/OFFSET rendering in Oracle and SQL Server, would fail to be processed
     correctly if the same parameter rendered in multiple places in the
     statement.



 .. change::
     :tags: bug, orm, regression
     :tickets: 6203

     Fixed regression where a deprecated form of :meth:`_orm.Query.join` were
     used, passing a series of entities to join from without any ON clause in a
     single :meth:`_orm.Query.join` call, would fail to function correctly.

 .. change::
     :tags: bug, mypy
     :tickets: 6147

     Applied a series of refactorings and fixes to accommodate for Mypy
     "incremental" mode across multiple files, which previously was not taken
     into account. In this mode the Mypy plugin has to accommodate Python
     datatypes expressed in other files coming in with less information than
     they have on a direct run.

     Additionally, a new decorator :func:`_orm.declarative_mixin` is added,
     which is necessary for the Mypy plugin to be able to definifitely identify
     a Declarative mixin class that is otherwise not used inside a particular
     Python file.

     .. seealso::

         :ref:`mypy_declarative_mixins`


 .. change::
     :tags: bug, mypy
     :tickets: 6205

     Fixed issue where the Mypy plugin would fail to interpret the
     "collection_class" of a relationship if it were a callable and not a class.
     Also improved type matching and error reporting for collection-oriented
     relationships.


 .. change::
     :tags: bug, sql
     :tickets: 6204

     Executing a :class:`_sql.Subquery` using :meth:`_engine.Connection.execute`
     is deprecated and will emit a deprecation warning; this use case was an
     oversight that should have been removed from 1.4. The operation will now
     execute the underlying :class:`_sql.Select` object directly for backwards
     compatibility. Similarly, the :class:`_sql.CTE` class is also not
     appropriate for execution. In 1.3, attempting to execute a CTE would result
     in an invalid "blank" SQL statement being executed; since this use case was
     not working it now raises :class:`_exc.ObjectNotExecutableError`.
     Previously, 1.4 was attempting to execute the CTE as a statement however it
     was working only erratically.

 .. change::
     :tags: bug, regression, orm
     :tickets: 6206

     Fixed critical regression where the :meth:`_orm.Query.yield_per` method in
     the ORM would set up the internal :class:`_engine.Result` to yield chunks
     at a time, however made use of the new :meth:`_engine.Result.unique` method
     which uniques across the entire result. This would lead to lost rows since
     the ORM is using ``id(obj)`` as the uniquing function, which leads to
     repeated identifiers for new objects as already-seen objects are garbage
     collected. 1.3's behavior here was to "unique" across each chunk, which
     does not actually produce "uniqued" results when results are yielded in
     chunks. As the :meth:`_orm.Query.yield_per` method is already explicitly
     disallowed when joined eager loading is in place, which is the primary
     rationale for the "uniquing" feature, the "uniquing" feature is now turned
     off entirely when :meth:`_orm.Query.yield_per` is used.

     This regression only applies to the legacy :class:`_orm.Query` object; when
     using :term:`2.0 style` execution, "uniquing" is not automatically applied.
     To prevent the issue from arising from explicit use of
     :meth:`_engine.Result.unique`, an error is now raised if rows are fetched
     from a "uniqued" ORM-level :class:`_engine.Result` if any
     :ref:`yield per <orm_queryguide_yield_per>` API is also in use, as the
     purpose of ``yield_per`` is to allow for arbitrarily large numbers of rows,
     which cannot be uniqued in memory without growing the number of entries to
     fit the complete result size.


 .. change::
     :tags: usecase, asyncio, postgresql
     :tickets: 6199

     Added accessors ``.sqlstate`` and synonym ``.pgcode`` to the ``.orig``
     attribute of the SQLAlchemy exception class raised by the asyncpg DBAPI
     adapter, that is, the intermediary exception object that wraps on top of
     that raised by the asyncpg library itself, but below the level of the
     SQLAlchemy dialect.

.. changelog::

1.4.5

:released: April 2, 2021

 .. change::
     :tags: bug, sql, postgresql
     :tickets: 6183

     Fixed bug in new :meth:`_functions.FunctionElement.render_derived` feature
     where column names rendered out explicitly in the alias SQL would not have
     proper quoting applied for case sensitive names and other non-alphanumeric
     names.

 .. change::
     :tags: bug, regression, orm
     :tickets: 6172

     Fixed regression where the :func:`_orm.joinedload` loader strategy would
     not successfully joinedload to a mapper that is mapper against a
     :class:`.CTE` construct.

 .. change::
     :tags: bug, regression, sql
     :tickets: 6181

     Fixed regression where use of the :meth:`.Operators.in_` method with a
     :class:`_sql.Select` object against a non-table-bound column would produce
     an ``AttributeError``, or more generally using a :class:`_sql.ScalarSelect`
     that has no datatype in a binary expression would produce invalid state.


 .. change::
     :tags: bug, mypy
     :tickets: sqlalchemy/sqlalchemy2-stubs/14

     Fixed issue in mypy plugin where newly added support for
     :func:`_orm.as_declarative` needed to more fully add the
     ``DeclarativeMeta`` class to the mypy interpreter's state so that it does
     not result in a name not found error; additionally improves how global
     names are setup for the plugin including the ``Mapped`` name.


 .. change::
     :tags: bug, mysql, regression
     :tickets: 6163

     Fixed regression in the MySQL dialect where the reflection query used to
     detect if a table exists would fail on very old MySQL 5.0 and 5.1 versions.

 .. change::
     :tags: bug, sql
     :tickets: 6184

     Added a new flag to the :class:`_engine.Dialect` class called
     :attr:`_engine.Dialect.supports_statement_cache`. This flag now needs to be present
     directly on a dialect class in order for SQLAlchemy's
     :ref:`query cache <sql_caching>` to take effect for that dialect. The
     rationale is based on discovered issues such as :ticket:`6173` revealing
     that dialects which hardcode literal values from the compiled statement,
     often the numerical parameters used for LIMIT / OFFSET, will not be
     compatible with caching until these dialects are revised to use the
     parameters present in the statement only. For third party dialects where
     this flag is not applied, the SQL logging will show the message "dialect
     does not support caching", indicating the dialect should seek to apply this
     flag once they have verified that no per-statement literal values are being
     rendered within the compilation phase.

     .. seealso::

       :ref:`engine_thirdparty_caching`

 .. change::
     :tags: bug, postgresql
     :tickets: 6099

     Fixed typo in the fix for :ticket:`6099` released in 1.4.4 that completely
     prevented this change from working correctly, i.e. the error message did not match
     what was actually emitted by pg8000.

 .. change::
     :tags: bug, orm, regression
     :tickets: 6171

     Scaled back the warning message added in :ticket:`5171` to not warn for
     overlapping columns in an inheritance scenario where a particular
     relationship is local to a subclass and therefore does not represent an
     overlap.

 .. change::
     :tags: bug, regression, oracle
     :tickets: 6173

     Fixed critical regression where the Oracle compiler would not maintain the
     correct parameter values in the LIMIT/OFFSET for a select due to a caching
     issue.


 .. change::
     :tags: bug, postgresql
     :tickets: 6170

     Fixed issue where the PostgreSQL :class:`.PGInspector`, when generated
     against an :class:`_engine.Engine`, would fail for ``.get_enums()``,
     ``.get_view_names()``, ``.get_foreign_table_names()`` and
     ``.get_table_oid()`` when used against a "future" style engine and not the
     connection directly.

 .. change::
     :tags: bug, schema
     :tickets: 6146

     Introduce a new parameter :paramref:`_types.Enum.omit_aliases` in
     :class:`_types.Enum` type allow filtering aliases when using a pep435 Enum.
     Previous versions of SQLAlchemy kept aliases in all cases, creating
     database enum type with additional states, meaning that they were treated
     as different values in the db. For backward compatibility this flag
     defaults to ``False`` in the 1.4 series, but will be switched to ``True``
     in a future version. A deprecation warning is raise if this flag is not
     specified and the passed enum contains aliases.

 .. change::
     :tags: bug, mssql
     :tickets: 6163

     Fixed a regression in MSSQL 2012+ that prevented the order by clause
     to be rendered when ``offset=0`` is used in a subquery.

 .. change::
     :tags: bug, asyncio
     :tickets: 6166


     Fixed issue where the asyncio extension could not be loaded
     if running Python 3.6 with the backport library of
     ``contextvars`` installed.

.. changelog::

1.4.4

:released: March 30, 2021

 .. change::
     :tags: bug, misc

     Adjusted the usage of the ``importlib_metadata`` library for loading
     setuptools entrypoints in order to accommodate for some deprecation
     changes.


 .. change::
     :tags: bug, postgresql
     :tickets: 6099

     Modified the ``is_disconnect()`` handler for the pg8000 dialect, which now
     accommodates for a new ``InterfaceError`` emitted by pg8000 1.19.0. Pull
     request courtesy Hamdi Burak Usul.


 .. change::
     :tags: bug, orm
     :tickets: 6139

     Fixed critical issue in the new :meth:`_orm.PropComparator.and_` feature
     where loader strategies that emit secondary SELECT statements such as
     :func:`_orm.selectinload` and :func:`_orm.lazyload` would fail to
     accommodate for bound parameters in the user-defined criteria in terms of
     the current statement being executed, as opposed to the cached statement,
     causing stale bound values to be used.

     This also adds a warning for the case where an object that uses
     :func:`_orm.lazyload` in conjunction with :meth:`_orm.PropComparator.and_`
     is attempted to be serialized; the loader criteria cannot reliably
     be serialized and deserialized and eager loading should be used for this
     case.


 .. change::
     :tags: bug, engine
     :tickets: 6138

     Repair wrong arguments to exception handling method
     in CursorResult.

 .. change::
     :tags: bug, regression, orm
     :tickets: 6144

     Fixed missing method :meth:`_orm.Session.get` from the
     :class:`_orm.ScopedSession` interface.


 .. change::
     :tags: usecase, engine
     :tickets: 6155

     Modified the context manager used by :class:`_engine.Transaction` so that
     an "already detached" warning is not emitted by the ending of the context
     manager itself, if the transaction were already manually rolled back inside
     the block. This applies to regular transactions, savepoint transactions,
     and legacy "marker" transactions. A warning is still emitted if the
     ``.rollback()`` method is called explicitly more than once.

.. changelog::
Links

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.667% when pulling 448d944 on pyup-update-sqlalchemy-1.4.3-to-1.4.6 into e3b6dee on master.

@pyup-bot
Copy link
Collaborator Author

pyup-bot commented Apr 9, 2021

Closing this in favor of #277

@pyup-bot pyup-bot closed this Apr 9, 2021
@avara1986 avara1986 deleted the pyup-update-sqlalchemy-1.4.3-to-1.4.6 branch April 9, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants