Changelog
### 0.0.5
```
This fixes when oauth2 resource providers are more technically correct in validating the content-type they receive, specifically for form data.
```
Links
- PyPI: https://pypi.org/project/aiohttp-oauth2
- Changelog: https://pyup.io/changelogs/aiohttp-oauth2/
- Repo: https://github.com/mrasband/aiohttp-oauth2
Changelog
### 3.8.1
```
==================
Bugfixes
--------
- Fix the error in handling the return value of `getaddrinfo`.
`getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
It will cause an index out of range error in aiohttp. For example, if user compile CPython with
`--disable-ipv6` option, but his system enable the ipv6.
`5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
- Do not install "examples" as a top-level package.
`6189 <https://github.com/aio-libs/aiohttp/issues/6189>`_
- Restored ability to connect IPv6-only host.
`6195 <https://github.com/aio-libs/aiohttp/issues/6195>`_
- Remove ``Signal`` from ``__all__``, replace ``aiohttp.Signal`` with ``aiosignal.Signal`` in docs
`6201 <https://github.com/aio-libs/aiohttp/issues/6201>`_
- Made chunked encoding HTTP header check stricter.
`6305 <https://github.com/aio-libs/aiohttp/issues/6305>`_
Improved Documentation
----------------------
- update quick starter demo codes.
`6240 <https://github.com/aio-libs/aiohttp/issues/6240>`_
- Added an explanation of how tiny timeouts affect performance to the client reference document.
`6274 <https://github.com/aio-libs/aiohttp/issues/6274>`_
- Add flake8-docstrings to flake8 configuration, enable subset of checks.
`6276 <https://github.com/aio-libs/aiohttp/issues/6276>`_
- Added information on running complex applications with additional tasks/processes -- :user:`Dreamsorcerer`.
`6278 <https://github.com/aio-libs/aiohttp/issues/6278>`_
Misc
----
- `6205 <https://github.com/aio-libs/aiohttp/issues/6205>`_
----
```
### 3.8.0
```
==================
Features
--------
- Added a ``GunicornWebWorker`` feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return ``web.AppRunner`` object.
`2988 <https://github.com/aio-libs/aiohttp/issues/2988>`_
- Switch from ``http-parser`` to ``llhttp``
`3561 <https://github.com/aio-libs/aiohttp/issues/3561>`_
- Use Brotli instead of brotlipy
`3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_
- Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp
cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly
disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python
mode is significantly slower than compiled one.
`3828 <https://github.com/aio-libs/aiohttp/issues/3828>`_
- Make access log use local time with timezone
`3853 <https://github.com/aio-libs/aiohttp/issues/3853>`_
- Implemented ``readuntil`` in ``StreamResponse``
`4054 <https://github.com/aio-libs/aiohttp/issues/4054>`_
- FileResponse now supports ETag.
`4594 <https://github.com/aio-libs/aiohttp/issues/4594>`_
- Add a request handler type alias ``aiohttp.typedefs.Handler``.
`4686 <https://github.com/aio-libs/aiohttp/issues/4686>`_
- ``AioHTTPTestCase`` is more async friendly now.
For people who use unittest and are used to use :py:exc:`~unittest.TestCase`
it will be easier to write new test cases like the sync version of the :py:exc:`~unittest.TestCase` class,
without using the decorator `unittest_run_loop`, just `async def test_*`.
The only difference is that for the people using python3.7 and below a new dependency is needed, it is ``asynctestcase``.
`4700 <https://github.com/aio-libs/aiohttp/issues/4700>`_
- Add validation of HTTP header keys and values to prevent header injection.
`4818 <https://github.com/aio-libs/aiohttp/issues/4818>`_
- Add predicate to ``AbstractCookieJar.clear``.
Add ``AbstractCookieJar.clear_domain`` to clean all domain and subdomains cookies only.
`4942 <https://github.com/aio-libs/aiohttp/issues/4942>`_
- Add keepalive_timeout parameter to web.run_app.
`5094 <https://github.com/aio-libs/aiohttp/issues/5094>`_
- Tracing for client sent headers
`5105 <https://github.com/aio-libs/aiohttp/issues/5105>`_
- Make type hints for http parser stricter
`5267 <https://github.com/aio-libs/aiohttp/issues/5267>`_
- Add final declarations for constants.
`5275 <https://github.com/aio-libs/aiohttp/issues/5275>`_
- Switch to external frozenlist and aiosignal libraries.
`5293 <https://github.com/aio-libs/aiohttp/issues/5293>`_
- Don't send secure cookies by insecure transports.
By default, the transport is secure if https or wss scheme is used.
Use `CookieJar(treat_as_secure_origin="http://127.0.0.1")` to override the default security checker.
`5571 <https://github.com/aio-libs/aiohttp/issues/5571>`_
- Always create a new event loop in ``aiohttp.web.run_app()``.
This adds better compatibility with ``asyncio.run()`` or if trying to run multiple apps in sequence.
`5572 <https://github.com/aio-libs/aiohttp/issues/5572>`_
- Add ``aiohttp.pytest_plugin.AiohttpClient`` for static typing of pytest plugin.
`5585 <https://github.com/aio-libs/aiohttp/issues/5585>`_
- Added a ``socket_factory`` argument to ``BaseTestServer``.
`5844 <https://github.com/aio-libs/aiohttp/issues/5844>`_
- Add compression strategy parameter to enable_compression method.
`5909 <https://github.com/aio-libs/aiohttp/issues/5909>`_
- Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- :user:`Hanaasagi`.
`5927 <https://github.com/aio-libs/aiohttp/issues/5927>`_
- Switched ``chardet`` to ``charset-normalizer`` for guessing the HTTP payload body encoding -- :user:`Ousret`.
`5930 <https://github.com/aio-libs/aiohttp/issues/5930>`_
- Added optional auto_decompress argument for HttpRequestParser
`5957 <https://github.com/aio-libs/aiohttp/issues/5957>`_
- Added support for HTTPS proxies to the extent CPython's
:py:mod:`asyncio` supports it -- by :user:`bmbouter`,
:user:`jborean93` and :user:`webknjaz`.
`5992 <https://github.com/aio-libs/aiohttp/issues/5992>`_
- Added ``base_url`` parameter to the initializer of :class:`~aiohttp.ClientSession`.
`6013 <https://github.com/aio-libs/aiohttp/issues/6013>`_
- Add Trove classifier and create binary wheels for 3.10. -- :user:`hugovk`.
`6079 <https://github.com/aio-libs/aiohttp/issues/6079>`_
- Started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes — :user:`asvetlov`.
`6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
- Started shipping platform-specific arm64 wheels for Apple Silicon — :user:`asvetlov`.
`6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
Bugfixes
--------
- Modify _drain_helper() to handle concurrent `await resp.write(...)` or `ws.send_json(...)` calls without race-condition.
`2934 <https://github.com/aio-libs/aiohttp/issues/2934>`_
- Started using `MultiLoopChildWatcher` when it's available under POSIX while setting up the test I/O loop.
`3450 <https://github.com/aio-libs/aiohttp/issues/3450>`_
- Only encode content-disposition filename parameter using percent-encoding.
Other parameters are encoded to quoted-string or RFC2231 extended parameter
value.
`4012 <https://github.com/aio-libs/aiohttp/issues/4012>`_
- Fixed HTTP client requests to honor ``no_proxy`` environment variables.
`4431 <https://github.com/aio-libs/aiohttp/issues/4431>`_
- Fix supporting WebSockets proxies configured via environment variables.
`4648 <https://github.com/aio-libs/aiohttp/issues/4648>`_
- Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations.
`4748 <https://github.com/aio-libs/aiohttp/issues/4748>`_
- Ensure a cleanup context is cleaned up even when an exception occurs during startup.
`4799 <https://github.com/aio-libs/aiohttp/issues/4799>`_
- Added a new exception type for Unix socket client errors which provides a more useful error message.
`4984 <https://github.com/aio-libs/aiohttp/issues/4984>`_
- Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse
`5106 <https://github.com/aio-libs/aiohttp/issues/5106>`_
- Only depend on typing_extensions for Python <3.8
`5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_
- Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode
`5192 <https://github.com/aio-libs/aiohttp/issues/5192>`_
- Fix cookies disappearing from HTTPExceptions.
`5233 <https://github.com/aio-libs/aiohttp/issues/5233>`_
- StaticResource prefixes no longer match URLs with a non-folder prefix. For example ``routes.static('/foo', '/foo')`` no longer matches the URL ``/foobar``. Previously, this would attempt to load the file ``/foo/ar``.
`5250 <https://github.com/aio-libs/aiohttp/issues/5250>`_
- Acquire the connection before running traces to prevent race condition.
`5259 <https://github.com/aio-libs/aiohttp/issues/5259>`_
- Add missing slots to _RequestContextManager`` and ``_WSRequestContextManager``
`5329 <https://github.com/aio-libs/aiohttp/issues/5329>`_
- Ensure sending a zero byte file does not throw an exception (round 2)
`5380 <https://github.com/aio-libs/aiohttp/issues/5380>`_
- Set "text/plain" when data is an empty string in client requests.
`5392 <https://github.com/aio-libs/aiohttp/issues/5392>`_
- Stop automatically releasing the ``ClientResponse`` object on calls to the ``ok`` property for the failed requests.
`5403 <https://github.com/aio-libs/aiohttp/issues/5403>`_
- Include query parameters from `params` keyword argument in tracing `URL`.
`5432 <https://github.com/aio-libs/aiohttp/issues/5432>`_
- Fix annotations
`5466 <https://github.com/aio-libs/aiohttp/issues/5466>`_
- Fixed the multipart POST requests processing to always release file
descriptors for the ``tempfile.Temporaryfile``-created
``_io.BufferedRandom`` instances of files sent within multipart request
bodies via HTTP POST requests -- by :user:`webknjaz`.
`5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_
- Fix 0 being incorrectly treated as an immediate timeout.
`5527 <https://github.com/aio-libs/aiohttp/issues/5527>`_
- Fixes failing tests when an environment variable <scheme>_proxy is set.
`5554 <https://github.com/aio-libs/aiohttp/issues/5554>`_
- Replace deprecated app handler design in ``tests/autobahn/server.py`` with call to ``web.run_app``; replace deprecated ``aiohttp.ws_connect`` calls in ``tests/autobahn/client.py`` with ``aiohttp.ClienSession.ws_connect``.
`5606 <https://github.com/aio-libs/aiohttp/issues/5606>`_
- Fixed test for ``HTTPUnauthorized`` that access the ``text`` argument. This is not used in any part of the code, so it's removed now.
`5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_
- Remove incorrect default from docs
`5727 <https://github.com/aio-libs/aiohttp/issues/5727>`_
- Remove external test dependency to http://httpbin.org
`5840 <https://github.com/aio-libs/aiohttp/issues/5840>`_
- Don't cancel current task when entering a cancelled timer.
`5853 <https://github.com/aio-libs/aiohttp/issues/5853>`_
- Added ``params`` keyword argument to ``ClientSession.ws_connect``. -- :user:`hoh`.
`5868 <https://github.com/aio-libs/aiohttp/issues/5868>`_
- Uses :py:class:`~asyncio.ThreadedChildWatcher` under POSIX to allow setting up test loop in non-main thread.
`5877 <https://github.com/aio-libs/aiohttp/issues/5877>`_
- Fix the error in handling the return value of `getaddrinfo`.
`getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
It will cause a index out of range error in aiohttp. For example, if user compile CPython with
`--disable-ipv6` option but his system enable the ipv6.
`5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
- Removed the deprecated ``loop`` argument from the ``asyncio.sleep``/``gather`` calls
`5905 <https://github.com/aio-libs/aiohttp/issues/5905>`_
- Return ``None`` from ``request.if_modified_since``, ``request.if_unmodified_since``, ``request.if_range`` and ``response.last_modified`` when corresponding http date headers are invalid.
`5925 <https://github.com/aio-libs/aiohttp/issues/5925>`_
- Fix resetting `SIGCHLD` signals in Gunicorn aiohttp Worker to fix `subprocesses` that capture output having an incorrect `returncode`.
`6130 <https://github.com/aio-libs/aiohttp/issues/6130>`_
- Raise ``400: Content-Length can't be present with Transfer-Encoding`` if both ``Content-Length`` and ``Transfer-Encoding`` are sent by peer by both C and Python implementations
`6182 <https://github.com/aio-libs/aiohttp/issues/6182>`_
Improved Documentation
----------------------
- Refactored OpenAPI/Swagger aiohttp addons, added ``aio-openapi``
`5326 <https://github.com/aio-libs/aiohttp/issues/5326>`_
- Fixed docs on request cookies type, so it matches what is actually used in the code (a
read-only dictionary-like object).
`5725 <https://github.com/aio-libs/aiohttp/issues/5725>`_
- Documented that the HTTP client ``Authorization`` header is removed
on redirects to a different host or protocol.
`5850 <https://github.com/aio-libs/aiohttp/issues/5850>`_
Misc
----
- `3927 <https://github.com/aio-libs/aiohttp/issues/3927>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#5389 <https://github.com/aio-libs/aiohttp/issues/5389>`_, `#5457 <https://github.com/aio-libs/aiohttp/issues/5457>`_, `#5486 <https://github.com/aio-libs/aiohttp/issues/5486>`_, `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_, `#5515 <https://github.com/aio-libs/aiohttp/issues/5515>`_, `#5625 <https://github.com/aio-libs/aiohttp/issues/5625>`_, `#5635 <https://github.com/aio-libs/aiohttp/issues/5635>`_, `#5648 <https://github.com/aio-libs/aiohttp/issues/5648>`_, `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_, `#5890 <https://github.com/aio-libs/aiohttp/issues/5890>`_, `#5914 <https://github.com/aio-libs/aiohttp/issues/5914>`_, `#5932 <https://github.com/aio-libs/aiohttp/issues/5932>`_, `#6002 <https://github.com/aio-libs/aiohttp/issues/6002>`_, `#6045 <https://github.com/aio-libs/aiohttp/issues/6045>`_, `#6131 <https://github.com/aio-libs/aiohttp/issues/6131>`_, `#6156 <https://github.com/aio-libs/aiohttp/issues/6156>`_, `#6165 <https://github.com/aio-libs/aiohttp/issues/6165>`_, `#6166 <https://github.com/aio-libs/aiohttp/issues/6166>`_
----
```
Links
- PyPI: https://pypi.org/project/aiohttp
- Changelog: https://pyup.io/changelogs/aiohttp/
- Repo: https://github.com/aio-libs/aiohttp
Changelog
### 2.0.1
```
Features
- Added Python 3.10 to CI & Updated the Docs
(see 1160)
- Enable mypy in CI (see 1101)
- Synchronized reading the responses from a connection
(see 1106)
Fixes
- Remove __del__ from Redis (Fixes 1115)
(see 1227)
- fix socket.error raises (see 1129)
- Fix buffer is closed error when using PythonParser class
(see 1213)
```
### 2.0.0
```
Features
- Port redis-py's client implementation to aioredis.
(see 891)
- Make hiredis an optional dependency.
(see 917)
```
Links
- PyPI: https://pypi.org/project/aioredis
- Changelog: https://pyup.io/changelogs/aioredis/
- Repo: https://github.com/aio-libs/aioredis-py
Changelog
### 1.7.5
```
:include_notes_from: unreleased
.. changelog::
```
### 1.7.4
```
:released: October 6, 2021
.. change::
:tags: bug, regression
:tickets: 934
Fixed a regression that prevented the use of post write hooks
on python version lower than 3.9
.. change::
:tags: bug, environment
:tickets: 944
Fixed issue where the :meth:`.MigrationContext.autocommit_block` feature
would fail to function when using a SQLAlchemy engine using 2.0 future
mode.
.. changelog::
```
### 1.7.3
```
:released: September 17, 2021
.. change::
:tags: bug, mypy
:tickets: 914
Fixed type annotations for the "constraint_name" argument of operations
``create_primary_key()``, ``create_foreign_key()``. Pull request courtesy
TilmanK.
.. changelog::
```
### 1.7.2
```
:released: September 17, 2021
.. change::
:tags: bug, typing
:tickets: 900
Added missing attributes from context stubs.
.. change::
:tags: bug, mypy
:tickets: 897
Fixed an import in one of the .pyi files that was triggering an
assertion error in some versions of mypy.
.. change::
:tags: bug, regression, ops
:tickets: 920
Fixed issue where registration of custom ops was prone to failure due to
the registration process running ``exec()`` on generated code that as of
the 1.7 series includes pep-484 annotations, which in the case of end user
code would result in name resolution errors when the exec occurs. The logic
in question has been altered so that the annotations are rendered as
forward references so that the ``exec()`` can proceed.
.. changelog::
```
### 1.7.1
```
:released: August 30, 2021
.. change::
:tags: bug, installation
:tickets: 893
Corrected "universal wheel" directive in setup.cfg so that building a wheel
does not target Python 2. The PyPi files index for 1.7.0 was corrected
manually. Pull request courtesy layday.
.. change::
:tags: bug, pep484
:tickets: 895
Fixed issue in generated .pyi files where default values for ``Optional``
arguments were missing, thereby causing mypy to consider them as required.
.. change::
:tags: bug, regression, batch
:tickets: 896
Fixed regression in batch mode due to :ticket:`883` where the "auto" mode
of batch would fail to accommodate any additional migration directives
beyond encountering an ``add_column()`` directive, due to a mis-application
of the conditional logic that was added as part of this change, leading to
"recreate" mode not being used in cases where it is required for SQLite
such as for unique constraints.
.. changelog::
```
### 1.7.0
```
:released: August 30, 2021
.. change::
:tags: bug, operations
:tickets: 879
Fixed regression due to :ticket:`803` where the ``.info`` and ``.comment``
attributes of ``Table`` would be lost inside of the :class:`.DropTableOp`
class, which when "reversed" into a :class:`.CreateTableOp` would then have
lost these elements. Pull request courtesy Nicolas CANIART.
.. change::
:tags: feature, environment
:tickets: 842
Enhance ``version_locations`` parsing to handle paths containing spaces.
The new configuration option ``version_path_separator`` specifies the
character to use when splitting the ``version_locations`` string. The
default for new configurations is ``version_path_separator = os``,
which will use ``os.pathsep`` (e.g., ``;`` on Windows).
.. change::
:tags: installation, changed
Alembic 1.7 now supports Python 3.6 and above; support for prior versions
including Python 2.7 has been dropped.
.. change::
:tags: bug, sqlite, batch
:tickets: 883
Batch "auto" mode will now select for "recreate" if the ``add_column()``
operation is used on SQLite, and the column itself meets the criteria for
SQLite where ADD COLUMN is not allowed, in this case a functional or
parenthesized SQL expression or a ``Computed`` (i.e. generated) column.
.. change::
:tags: changed, installation
:tickets: 674
Make the ``python-dateutil`` library an optional dependency.
This library is only required if the ``timezone`` option
is used in the Alembic configuration.
An extra require named ``tz`` is available with
``pip install alembic[tz]`` to install it.
.. change::
:tags: bug, commands
:tickets: 856
Re-implemented the ``python-editor`` dependency as a small internal
function to avoid the need for external dependencies.
.. change::
:tags: usecase, batch
:tickets: 884
Named CHECK constraints are now supported by batch mode, and will
automatically be part of the recreated table assuming they are named. They
also can be explicitly dropped using ``op.drop_constraint()``. For
"unnamed" CHECK constraints, these are still skipped as they cannot be
distinguished from the CHECK constraints that are generated by the
``Boolean`` and ``Enum`` datatypes.
Note that this change may require adjustments to migrations that drop or
rename columns which feature an associated named check constraint, such
that an additional ``op.drop_constraint()`` directive should be added for
that named constraint as there will no longer be an associated column
for it; for the ``Boolean`` and ``Enum`` datatypes, an ``existing_type``
keyword may be passed to ``BatchOperations.drop_constraint`` as well.
.. seealso::
:ref:`batch_schematype_constraints`
:ref:`batch_check_constraints`
.. change::
:tags: changed, installation
:tickets: 885
The dependency on ``pkg_resources`` which is part of ``setuptools`` has
been removed, so there is no longer any runtime dependency on
``setuptools``. The functionality has been replaced with
``importlib.metadata`` and ``importlib.resources`` which are both part of
Python std.lib, or via pypy dependency ``importlib-metadata`` for Python
version < 3.8 and ``importlib-resources`` for Python version < 3.9
(while importlib.resources was added to Python in 3.7, it did not include
the "files" API until 3.9).
.. change::
:tags: feature, tests
:tickets: 855
Created a "test suite" similar to the one for SQLAlchemy, allowing
developers of third-party dialects to test their code against a set of
Alembic tests that have been specially selected to exercise
back-end database operations. At the time of release,
third-party dialects that have adopted the Alembic test suite to verify
compatibility include
`CockroachDB <https://pypi.org/project/sqlalchemy-cockroachdb/>`_ and
`SAP ASE (Sybase) <https://pypi.org/project/sqlalchemy-sybase/>`_.
.. change::
:tags: bug, postgresql
:tickets: 874
Fixed issue where usage of the PostgreSQL ``postgresql_include`` option
within a :meth:`.Operations.create_index` would raise a KeyError, as the
additional column(s) need to be added to the table object used by the
construct internally. The issue is equivalent to the SQL Server issue fixed
in :ticket:`513`. Pull request courtesy Steven Bronson.
.. change::
:tags: feature, general
pep-484 type annotations have been added throughout the library.
Additionally, stub .pyi files have been added for the "dynamically"
generated Alembic modules ``alembic.op`` and ``alembic.config``, which
include complete function signatures and docstrings, so that the functions
in these namespaces will have both IDE support (vscode, pycharm, etc) as
well as support for typing tools like Mypy. The files themselves are
statically generated from their source functions within the source tree.
.. changelog::
```
### 1.6.5
```
:released: May 27, 2021
.. change::
:tags: bug, autogenerate
:tickets: 849
Fixed issue where dialect-specific keyword arguments within the
:class:`.DropIndex` operation directive would not render in the
autogenerated Python code. As support was improved for adding dialect
specific arguments to directives as part of :ticket:`803`, in particular
arguments such as "postgresql_concurrently" which apply to the actual
create/drop of the index, support was needed for these to render even in a
drop index operation. Pull request courtesy Jet Zhou.
.. changelog::
```
### 1.6.4
```
:released: May 24, 2021
.. change::
:tags: bug, regression, op directives
:tickets: 848
Fixed regression caused by just fixed :ticket:`844` that scaled back the
filter for ``unique=True/index=True`` too far such that these directives no
longer worked for the ``op.create_table()`` op, this has been fixed.
.. changelog::
```
### 1.6.3
```
:released: May 21, 2021
.. change::
:tags: bug, regression, autogenerate
:tickets: 844
Fixed 1.6-series regression where ``UniqueConstraint`` and to a lesser
extent ``Index`` objects would be doubled up in the generated model when
the ``unique=True`` / ``index=True`` flags were used.
.. change::
:tags: bug, autogenerate
:tickets: 839
Fixed a bug where paths defined in post-write hook options
would be wrongly escaped in non posix environment (Windows).
.. change::
:tags: bug, regression, versioning
:tickets: 843
Fixed regression where a revision file that contained its own down revision
as a dependency would cause an endless loop in the traversal logic.
.. changelog::
```
### 1.6.2
```
:released: May 6, 2021
.. change::
:tags: bug, versioning, regression
:tickets: 839
Fixed additional regression nearly the same as that of :ticket:`838` just
released in 1.6.1 but within a slightly different codepath, where "alembic
downgrade head" (or equivalent) would fail instead of iterating no
revisions.
.. changelog::
```
### 1.6.1
```
:released: May 6, 2021
.. change::
:tags: bug, versioning, regression
:tickets: 838
Fixed regression in new revisioning traversal where "alembic downgrade
base" would fail if the database itself were clean and unversioned;
additionally repairs the case where downgrade would fail if attempting
to downgrade to the current head that is already present.
.. changelog::
```
### 1.6.0
```
:released: May 3, 2021
.. change::
:tags: bug, autogenerate
:tickets: 803
Refactored the implementation of :class:`.MigrateOperation` constructs such
as :class:`.CreateIndexOp`, :class:`.CreateTableOp`, etc. so that they no
longer rely upon maintaining a persistent version of each schema object
internally; instead, the state variables of each operation object will be
used to produce the corresponding construct when the operation is invoked.
The rationale is so that environments which make use of
operation-manipulation schemes such as those those discussed in
:ref:`autogen_rewriter` are better supported, allowing end-user code to
manipulate the public attributes of these objects which will then be
expressed in the final output, an example is
``some_create_index_op.kw["postgresql_concurrently"] = True``.
Previously, these objects when generated from autogenerate would typically
hold onto the original, reflected element internally without honoring the
other state variables of each construct, preventing the public API from
working.
.. change::
:tags: bug, environment
:tickets: 829
Fixed regression caused by the SQLAlchemy 1.4/2.0 compatibility switch
where calling ``.rollback()`` or ``.commit()`` explicitly within the
``context.begin_transaction()`` context manager would cause it to fail when
the block ended, as it did not expect that the transaction was manually
closed.
.. change::
:tags: bug, autogenerate
:tickets: 827
Improved the rendering of ``op.add_column()`` operations when adding
multiple columns to an existing table, so that the order of these
statements matches the order in which the columns were declared in the
application's table metadata. Previously the added columns were being
sorted alphabetically.
.. change::
:tags: feature, autogenerate
:tickets: 819
Fix the documentation regarding the default command-line argument position of
the revision script filename within the post-write hook arguments. Implement a
``REVISION_SCRIPT_FILENAME`` token, enabling the position to be changed. Switch
from ``str.split()`` to ``shlex.split()`` for more robust command-line argument
parsing.
.. change::
:tags: feature
:tickets: 822
Implement a ``.cwd`` (current working directory) suboption for post-write hooks
(of type ``console_scripts``). This is useful for tools like pre-commit, which
rely on the working directory to locate the necessary config files. Add
pre-commit as an example to the documentation. Minor change: rename some variables
from ticket 819 to improve readability.
.. change::
:tags: bug, versioning
:tickets: 765, 464
The algorithm used for calculating downgrades/upgrades/iterating
revisions has been rewritten, to resolve ongoing issues of branches
not being handled consistently particularly within downgrade operations,
as well as for overall clarity and maintainability. This change includes
that a deprecation warning is emitted if an ambiguous command such
as "downgrade -1" when multiple heads are present is given.
In particular, the change implements a long-requested use case of allowing
downgrades of a single branch to a branchpoint.
Huge thanks to Simon Bowly for their impressive efforts in successfully
tackling this very difficult problem.
.. change::
:tags: bug, batch
:tickets: 799
Added missing ``batch_op.create_table_comment()``,
``batch_op.drop_table_comment()`` directives to batch ops.
.. changelog::
```
Links
- PyPI: https://pypi.org/project/alembic
- Changelog: https://pyup.io/changelogs/alembic/
- Homepage: https://alembic.sqlalchemy.org
- Docs: https://pythonhosted.org/alembic/
Changelog
### 3.8.1
```
- Allowed the use of tzlocal v4.0+ in addition to v2.*
```
### 3.8.0
```
- Allowed passing through keyword arguments to the underlying stdlib executors in the
thread/process pool executors (PR by Albert Xu)
```
Links
- PyPI: https://pypi.org/project/apscheduler
- Changelog: https://pyup.io/changelogs/apscheduler/
- Repo: https://github.com/agronholm/apscheduler
- Docs: https://pythonhosted.org/APScheduler/
Changelog
### 3.15.0
```
*******************
Features:
- Allow passing a `dict` to `fields.Nested` (:pr:`1935`).
Thanks :user:`sirosen` for the PR.
Other changes:
- Address distutils deprecation warning in Python 3.10 (:pr:`1903`).
Thanks :user:`kkirsche` for the PR.
- Add py310 to black target-version (:pr:`1921`).
- Drop support for Python 3.6 (:pr:`1923`).
- Use postponed evaluation of annotations (:pr:`1932`).
Thanks :user:`Isira-Seneviratne` for the PR.
```
### 3.14.1
```
*******************
Bug fixes:
- Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_
(:pr:`1905`). Thanks :user:`bwindsor` for the catch and patch.
```
### 3.14.0
```
*******************
Bug fixes:
- Fix ``fields.TimeDelta`` serialization precision (:issue:`1865`).
Thanks :user:`yarsanich` for reporting.
Other changes:
- Fix type-hints for data arg in Schema.validate to accept
list of dictionaries (:issue:`1790`, :pr:`1868`).
Thanks :user:`yourun-proger` for PR.
- Improve warning when passing metadata as keyword arguments (:pr:`1882`).
Thanks :user:`traherom` for the PR.
- Don't build universal wheels. We don't support Python 2 anymore.
(:issue:`1860`) Thanks :user:`YKdvd` for reporting.
- Make the build reproducible (:pr:`1862`).
- Drop support for Python 3.5 (:pr:`1863`).
- Test against Python 3.10 (:pr:`1888`).
```
### 3.13.0
```
*******************
Features:
- Replace ``missing``/``default`` field parameters with
``load_default``/``dump_default`` (:pr:`1742`).
Thanks :user:`sirosen` for the PR.
Deprecations:
- The use of ``missing``/``default`` field parameters is deprecated and will be
removed in marshmallow 4. ``load_default``/``dump_default`` should be used
instead.
```
### 3.12.2
```
*******************
Bug fixes:
- Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change
introduced in 3.12.0 that causes issues when field names conflict with
``Schema`` attributes or methods. ``Fields``\s are still accessible on a
``Schema`` instance through the ``fields`` attribute. (:pr:`1843`)
```
### 3.12.1
```
*******************
Bug fixes:
- Fix bug that raised an ``AttributeError`` when instantiating a
``Schema`` with a field named ``parent`` (:issue:`1808`).
Thanks :user:`flying-sheep` for reporting and helping with the fix.
```
### 3.12.0
```
*******************
Features:
- Add ``validate.And`` (:issue:`1768`).
Thanks :user:`rugleb` for the suggestion.
- Add type annotations to ``marshmallow.decorators`` (:issue:`1788`, :pr:`1789`).
Thanks :user:`michaeldimchuk` for the PR.
- Let ``Field``\s be accessed by name as ``Schema`` attributes (:pr:`1631`).
Other changes:
- Improve types in ``marshmallow.validate`` (:pr:`1786`).
- Make ``marshmallow.validate.Validator`` an abstract base class (:pr:`1786`).
- Remove unnecessary list cast (:pr:`1785`).
```
Links
- PyPI: https://pypi.org/project/marshmallow
- Changelog: https://pyup.io/changelogs/marshmallow/
- Repo: https://github.com/marshmallow-code/marshmallow
Changelog
### 0.16.0
```
This release adds Python 3.10 support, updates bundled libuv to 1.42.0
and fixes a handful of issues.
Changes
=======
* Python 3.10 support (432)
(by elprans in 2519e2df for 432)
* Bump vendored libuv to 1.42.0 (433)
(by elprans in a62f7818 for 433)
* Use cibuildwheel to build wheels (435)
(by elprans in 20febe0b for 435)
* Add support for `<timer handle>.when()`
(by Jens Jorgensen in 62b2af9c)
Fixes
=====
* Fix ref issue when protocol is in Cython
(by fantix in 70cafc82 for 2222)
* Set `python_requires` in setup.py
(by graingert in c808a663)
* SSL: schedule first data after waiter wakeup
(by fantix in 2081db89)
* Fix a possible race condition in sslproto test
(by fantix in b0526cd5 for 412)
* Fix `call_soon_threadsafe` thread safety
(by fantix in 4b803b15)
```
### 0.15.3
```
Bug Fixes
* SSL: schedule first data after waiter wakeup
(by fantix in 0df12282)
* Fix a possible race condition in sslproto test
(by fantix in 2e71c4c2 for 412)
* Fix `call_soon_threadsafe` thread safety
(by fantix and hehaha in 6387a4e4 for 408)
```
Links
- PyPI: https://pypi.org/project/uvloop
- Changelog: https://pyup.io/changelogs/uvloop/
- Repo: http://github.com/MagicStack/uvloop
Changelog
### 1.4.27
```
:include_notes_from: unreleased_14
.. changelog::
```
### 1.4.26
```
:released: October 19, 2021
.. change::
:tags: orm
:tickets: 6284
Passing a :class:`.Query` object to :meth:`_orm.Session.execute` is not
the intended use of this object, and will now raise a deprecation warning.
.. change::
:tags: bug, postgresql
:tickets: 5387
Added a "disconnect" condition for the "SSL SYSCALL error: Bad address"
error message as reported by psycopg2. Pull request courtesy Zeke Brechtel.
.. change::
:tags: bug, orm
Improved the exception message generated when configuring a mapping with
joined table inheritance where the two tables either have no foreign key
relationships set up, or where they have multiple foreign key relationships
set up. The message is now ORM specific and includes context that the
:paramref:`_orm.Mapper.inherit_condition` parameter may be needed
particularly for the ambiguous foreign keys case.
.. change::
:tags: bug, sql
:tickets: 6520
Fixed issue where SQL queries using the
:meth:`_functions.FunctionElement.within_group` construct could not be
pickled, typically when using the ``sqlalchemy.ext.serializer`` extension
but also for general generic pickling.
.. change::
:tags: bug, orm
:tickets: 7189
Fixed issue with :func:`_orm.with_loader_criteria` feature where ON
criteria would not be added to a JOIN for a query of the form
``select(A).join(B)``, stating a target while making use of an implicit
ON clause.
.. change::
:tags: bug, orm
:tickets: 7205
Fixed bug where the ORM "plugin", necessary for features such as
:func:`_orm.with_loader_criteria` to work correctly, would not be applied
to a :func:`_sql.select` which queried from an ORM column expression if it
made use of the :meth:`_sql.ColumnElement.label` modifier.
.. change::
:tags: bug, mypy
:tickets: 6435
Fixed issue in mypy plugin to improve upon some issues detecting ``Enum()``
SQL types containing custom Python enumeration classes. Pull request
courtesy Hiroshi Ogawa.
.. change::
:tags: bug, mysql
:tickets: 7144
Fixed issue in MySQL :func:`_mysql.match` construct where passing a clause
expression such as :func:`_sql.bindparam` or other SQL expression for the
"against" parameter would fail. Pull request courtesy Anton Kovalevich.
.. change::
:tags: bug, mssql
:tickets: 7160
Fixed issue with :meth:`.Inspector.get_foreign_keys` where foreign
keys were omitted if they were established against a unique
index instead of a unique constraint.
.. change::
:tags: usecase, mssql
Added reflection support for SQL Server foreign key options, including
"ON UPDATE" and "ON DELETE" values of "CASCADE" and "SET NULL".
.. change::
:tags: bug, sql
:tickets: 4123
Repaired issue in new :paramref:`_sql.HasCTE.cte.nesting` parameter
introduced with :ticket:`4123` where a recursive :class:`_sql.CTE` using
:paramref:`_sql.HasCTE.cte.recursive` in typical conjunction with UNION
would not compile correctly. Additionally makes some adjustments so that
the :class:`_sql.CTE` construct creates a correct cache key.
Pull request courtesy Eric Masseran.
.. change::
:tags: bug, engine
:tickets: 7130
Fixed issue where the deprecation warning for the :class:`.URL` constructor
which indicates that the :meth:`.URL.create` method should be used would
not emit if a full positional argument list of seven arguments were passed;
additionally, validation of URL arguments will now occur if the constructor
is called in this way, which was being skipped previously.
.. change::
:tags: bug, orm
:tickets: 7103
Add missing methods added in :ticket:`6991` to
:class:`_scoping.scoped_session` and :func:`_asyncio.async_scoped_session`.
.. change::
:tags: bug, examples
:tickets: 7169
Repaired the examples in examples/versioned_rows to use SQLAlchemy 1.4 APIs
correctly; these examples had been missed when API changes like removing
"passive" from :meth:`_orm.Session.is_modified` were made as well as the
:meth:`_ormevents.SessionEvents.do_orm_execute()` event hook were added.
.. change::
:tags: bug, orm
:tickets: 6974, 6972
An extra layer of warning messages has been added to the functionality
of :meth:`_orm.Query.join` and the ORM version of
:meth:`_sql.Select.join`, where a few places where "automatic aliasing"
continues to occur will now be called out as a pattern to avoid, mostly
specific to the area of joined table inheritance where classes that share
common base tables are being joined together without using explicit aliases.
One case emits a legacy warning for a pattern that's not recommended,
the other case is fully deprecated.
The automatic aliasing within ORM join() which occurs for overlapping
mapped tables does not work consistently with all APIs such as
:func:`_orm.contains_eager()`, and rather than continue to try to make
these use cases work everywhere, replacing with a more user-explicit
pattern is clearer, less prone to bugs and simplifies SQLAlchemy's
internals further.
The warnings include links to the errors.rst page where each pattern is
demonstrated along with the recommended pattern to fix.
.. seealso::
:ref:`error_xaj1`
:ref:`error_xaj2`
.. change::
:tags: bug, sql
:tickets: 7061
Account for the :paramref:`_sql.table.schema` parameter passed to
the :func:`_sql.table` construct, such that it is taken into account
when accessing the :attr:`_sql.TableClause.fullname` attribute.
.. change::
:tags: bug, sql
:tickets: 7140
Fixed an inconsistency in the :meth:`_sql.ColumnOperators.any_` /
:meth:`_sql.ColumnOperators.all_` functions / methods where the special
behavior these functions have of "flipping" the expression such that the
"ANY" / "ALL" expression is always on the right side would not function if
the comparison were against the None value, that is, "column.any_() ==
None" should produce the same SQL expression as "null() == column.any_()".
Added more docs to clarify this as well, plus mentions that any_() / all_()
generally supersede the ARRAY version "any()" / "all()".
.. change::
:tags: engine, bug, postgresql
:tickets: 3247
The :meth:`_reflection.Inspector.reflect_table` method now supports
reflecting tables that do not have user defined columns. This allows
:meth:`_schema.MetaData.reflect` to properly complete reflection on
databases that contain such tables. Currently, only PostgreSQL is known to
support such a construct among the common database backends.
.. change::
:tags: sql, bug, regression
:tickets: 7177
Fixed issue where "expanding IN" would fail to function correctly with
datatypes that use the :meth:`_types.TypeEngine.bind_expression` method,
where the method would need to be applied to each element of the
IN expression rather than the overall IN expression itself.
.. change::
:tags: postgresql, bug, regression
:tickets: 7177
Fixed issue where IN expressions against a series of array elements, as can
be done with PostgreSQL, would fail to function correctly due to multiple
issues within the "expanding IN" feature of SQLAlchemy Core that was
standardized in version 1.4. The psycopg2 dialect now makes use of the
:meth:`_types.TypeEngine.bind_expression` method with :class:`_types.ARRAY`
to portably apply the correct casts to elements. The asyncpg dialect was
not affected by this issue as it applies bind-level casts at the driver
level rather than at the compiler level.
.. change::
:tags: bug, mysql
:tickets: 7204
Fixed installation issue where the ``sqlalchemy.dialects.mysql`` module
would not be importable if "greenlet" were not installed.
.. change::
:tags: bug, mssql
:tickets: 7168
Fixed issue with :meth:`.Inspector.has_table` where it would return False
if a local temp table with the same name from a different session happened
to be returned first when querying tempdb. This is a continuation of
:ticket:`6910` which accounted for the temp table existing only in the
alternate session and not the current one.
.. change::
:tags: bug, orm
:tickets: 7128
Fixed bug where iterating a :class:`.Result` from a :class:`_orm.Session`
after that :class:`_orm.Session` were closed would partially attach objects
to that session in an essentially invalid state. It now raises an exception
with a link to new documentation if an **un-buffered** result is iterated
from a :class:`_orm.Session` that was closed or otherwise had the
:meth:`_orm.Session.expunge_all` method called after that :class:`.Result`
was generated. The ``prebuffer_rows`` execution option, as is used
automatically by the asyncio extension for client-side result sets, may be
used to produce a :class:`.Result` where the ORM objects are prebuffered,
and in this case iterating the result will produce a series of detached
objects.
.. seealso::
:ref:`error_lkrp`
.. change::
:tags: bug, mssql, regression
:tickets: 7129
Fixed bug in SQL Server :class:`_mssql.DATETIMEOFFSET` datatype where the
ODBC implementation would not generate the correct DDL, for cases where the
type were converted using the ``dialect.type_descriptor()`` method, the
usage of which is illustrated in some documented examples for
:class:`.TypeDecorator`, though not necessary for most datatypes.
Regression was introduced by :ticket:`6366`. As part of this change, the
full list of SQL Server date types have been amended to return a "dialect
impl" that generates the same DDL name as the supertype.
.. change::
:tags: bug, sql
:tickets: 7153
Adjusted the "column disambiguation" logic that's new in 1.4, where the
same expression repeated gets an "extra anonymous" label, so that the logic
more aggressively deduplicates those labels when the repeated element
is the same Python expression object each time, as occurs in cases like
when using "singleton" values like :func:`_sql.null`. This is based on
the observation that at least some databases (e.g. MySQL, but not SQLite)
will raise an error if the same label is repeated inside of a subquery.
.. change::
:tags: bug, orm
:tickets: 7154
Related to :ticket:`7153`, fixed an issue where result column lookups would
fail for "adapted" SELECT statements that selected for "constant" value
expressions most typically the NULL expression, as would occur in such
places as joined eager loading in conjunction with limit/offset. This was
overall a regression due to issue :ticket:`6259` which removed all
"adaption" for constants like NULL, "true", and "false" when rewriting
expressions in a SQL statement, but this broke the case where the same
adaption logic were used to resolve the constant to a labeled expression
for the purposes of result set targeting.
.. change::
:tags: bug, orm, regression
:tickets: 7134
Fixed regression where ORM loaded objects could not be pickled in cases
where loader options making use of ``"*"`` were used in certain
combinations, such as combining the :func:`_orm.joinedload` loader strategy
with ``raiseload('*')`` of sub-elements.
.. change::
:tags: bug, engine
:tickets: 7077
Implemented proper ``__reduce__()`` methods for all SQLAlchemy exception
objects to ensure they all support clean round trips when pickling, as
exception objects are often serialized for the purposes of various
debugging tools.
.. change::
:tags: bug, orm, regression
:tickets: 7209
Fixed regression where the use of a :class:`_hybrid.hybrid_property`
attribute or a mapped :func:`_orm.composite` attribute as a key passed to
the :meth:`_dml.Update.values` method for an ORM-enabled
:class:`_dml.Update` statement, as well as when using it via the legacy
:meth:`_orm.Query.update` method, would be processed for incoming
ORM/hybrid/composite values within the compilation stage of the UPDATE
statement, which meant that in those cases where caching occurred,
subsequent invocations of the same statement would no longer receive the
correct values. This would include not only hybrids that use the
:meth:`_hybrid.hybrid_property.update_expression` method, but any use of a
plain hybrid attribute as well. For composites, the issue instead caused a
non-repeatable cache key to be generated, which would break caching and
could fill up the statement cache with repeated statements.
The :class:`_dml.Update` construct now handles the processing of key/value
pairs passed to :meth:`_dml.Update.values` and
:meth:`_dml.Update.ordered_values` up front when the construct is first
generated, before the cache key has been generated so that the key/value
pairs are processed each time, and so that the cache key is generated
against the individual column/value pairs that will ultimately be
used in the statement.
.. changelog::
```
### 1.4.25
```
:released: September 22, 2021
.. change::
:tags: bug, platform, regression
:tickets: 7024
Fixed regression due to :ticket:`7024` where the reorganization of the
"platform machine" names used by the ``greenlet`` dependency mis-spelled
"aarch64" and additionally omitted uppercase "AMD64" as is needed for
Windows machines. Pull request courtesy James Dow.
.. changelog::
```
### 1.4.24
```
:released: September 22, 2021
.. change::
:tags: bug, asyncio
:tickets: 6943
Fixed a bug in :meth:`_asyncio.AsyncSession.execute` and
:meth:`_asyncio.AsyncSession.stream` that required ``execution_options``
to be an instance of ``immutabledict`` when defined. It now
correctly accepts any mapping.
.. change::
:tags: engine, asyncio, usecase
:tickets: 6832
Improve the interface used by adapted drivers, like the asyncio ones,
to access the actual connection object returned by the driver.
The :class:`._ConnectionFairy` object has two new attributes:
* :attr:`._ConnectionFairy.dbapi_connection` always represents a DBAPI
compatible object. For pep-249 drivers, this is the DBAPI connection as
it always has been, previously accessed under the ``.connection``
attribute. For asyncio drivers that SQLAlchemy adapts into a pep-249
interface, the returned object will normally be a SQLAlchemy adaption
object called :class:`_engine.AdaptedConnection`.
* :attr:`._ConnectionFairy.driver_connection` always represents the actual
connection object maintained by the third party pep-249 DBAPI or async
driver in use. For standard pep-249 DBAPIs, this will always be the same
object as that of the ``dbapi_connection``. For an asyncio driver, it
will be the underlying asyncio-only connection object.
The ``.connection`` attribute remains available and is now a legacy alias
of ``.dbapi_connection``.
.. seealso::
:ref:`faq_dbapi_connection`
.. change::
:tags: bug, sql
:tickets: 7052
Implemented missing methods in :class:`_functions.FunctionElement` which,
while unused, would lead pylint to report them as unimplemented abstract
methods.
.. change::
:tags: bug, mssql, reflection
:tickets: 6910
Fixed an issue where :meth:`_reflection.has_table` returned
``True`` for local temporary tables that actually belonged to a
different SQL Server session (connection). An extra check is now
performed to ensure that the temp table detected is in fact owned
by the current session.
.. change::
:tags: bug, engine, regression
:tickets: 6913
Fixed issue where the ability of the
:meth:`_events.ConnectionEvents.before_execute` method to alter the SQL
statement object passed, returning the new object to be invoked, was
inadvertently removed. This behavior has been restored.
.. change::
:tags: bug, engine
:tickets: 6958
Ensure that ``str()`` is called on the an
:paramref:`_url.URL.create.password` argument, allowing usage of objects
that implement the ``__str__()`` method as password attributes. Also
clarified that one such object is not appropriate to dynamically change the
password for each database connection; the approaches at
:ref:`engines_dynamic_tokens` should be used instead.
.. change::
:tags: bug, orm, regression
:tickets: 6979
Fixed ORM issue where column expressions passed to ``query()`` or
ORM-enabled ``select()`` would be deduplicated on the identity of the
object, such as a phrase like ``select(A.id, null(), null())`` would
produce only one "NULL" expression, which previously was not the case in
1.3. However, the change also allows for ORM expressions to render as given
as well, such as ``select(A.data, A.data)`` will produce a result row with
two columns.
.. change::
:tags: bug, engine
:tickets: 6983
Fixed issue in :class:`_engine.URL` where validation of "drivername" would
not appropriately respond to the ``None`` value where a string were
expected.
.. change::
:tags: bug, mypy
:tickets: 6950
Fixed issue where mypy plugin would crash when interpreting a
``query_expression()`` construct.
.. change::
:tags: usecase, sql
:tickets: 4123
Added new parameter :paramref:`_sql.HasCTE.cte.nesting` to the
:class:`_sql.CTE` constructor and :meth:`_sql.HasCTE.cte` method, which
flags the CTE as one which should remain nested within an enclosing CTE,
rather than being moved to the top level of the outermost SELECT. While in
the vast majority of cases there is no difference in SQL functionality,
users have identified various edge-cases where true nesting of CTE
constructs is desirable. Much thanks to Eric Masseran for lots of work on
this intricate feature.
.. change::
:tags: usecase, engine, orm
:tickets: 6990
Added new methods :meth:`_orm.Session.scalars`,
:meth:`_engine.Connection.scalars`, :meth:`_asyncio.AsyncSession.scalars`
and :meth:`_asyncio.AsyncSession.stream_scalars`, which provide a short cut
to the use case of receiving a row-oriented :class:`_result.Result` object
and converting it to a :class:`_result.ScalarResult` object via the
:meth:`_engine.Result.scalars` method, to return a list of values rather
than a list of rows. The new methods are analogous to the long existing
:meth:`_orm.Session.scalar` and :meth:`_engine.Connection.scalar` methods
used to return a single value from the first row only. Pull request
courtesy Miguel Grinberg.
.. change::
:tags: usecase, orm
:tickets: 6955
Added loader options to :meth:`_orm.Session.merge` and
:meth:`_asyncio.AsyncSession.merge` via a new
:paramref:`_orm.Session.merge.options` parameter, which will apply the
given loader options to the ``get()`` used internally by merge, allowing
eager loading of relationships etc. to be applied when the merge process
loads a new object. Pull request courtesy Daniel Stone.
.. change::
:tags: feature, asyncio, mysql
:tickets: 6993
Added initial support for the ``asyncmy`` asyncio database driver for MySQL
and MariaDB. This driver is very new, however appears to be the only
current alternative to the ``aiomysql`` driver which currently appears to
be unmaintained and is not working with current Python versions. Much
thanks to long2ice for the pull request for this dialect.
.. seealso::
:ref:`asyncmy`
.. change::
:tags: bug, asyncio
Added missing ``**kw`` arguments to the
:meth:`_asyncio.AsyncSession.connection` method.
.. change::
:tags: bug, sql
:tickets: 7055
Fixed a two issues where combinations of ``select()`` and ``join()`` when
adapted to form a copy of the element would not completely copy the state
of all column objects associated with subqueries. A key problem this caused
is that usage of the :meth:`_sql.ClauseElement.params` method (which should
probably be moved into a legacy category as it is inefficient and error
prone) would leave copies of the old :class:`_sql.BindParameter` objects
around, leading to issues in correctly setting the parameters at execution
time.
.. change::
:tags: bug, orm, regression
:tickets: 6924
Fixed issue in recently repaired ``Query.with_entities()`` method where the
flag that determines automatic uniquing for legacy ORM ``Query`` objects
only would be set to ``True`` inappropriately in cases where the
``with_entities()`` call would be setting the ``Query`` to return
column-only rows, which are not uniqued.
.. change::
:tags: bug, postgresql
:tickets: 6912
Qualify ``version()`` call to avoid shadowing issues if a different
search path is configured by the user.
.. change::
:tags: bug, engine, postgresql
:tickets: 6963
Fixed issue where an engine that had
:paramref:`_sa.create_engine.implicit_returning` set to False would fail to
function when PostgreSQL's "fast insertmany" feature were used in
conjunction with a ``Sequence``, as well as if any kind of "executemany"
with "return_defaults()" were used in conjunction with a ``Sequence``. Note
that PostgreSQL "fast insertmany" uses "RETURNING" by definition, when the
SQL statement is passed to the driver; overall, the
:paramref:`_sa.create_engine.implicit_returning` flag is legacy and has no
real use in modern SQLAlchemy, and will be deprecated in a separate change.
.. change::
:tags: bug, mypy
:tickets: 6937
Fixed issue in mypy plugin where columns on a mixin would not be correctly
interpreted if the mapped class relied upon a ``__tablename__`` routine
that came from a superclass.
.. change::
:tags: bug, postgresql
:tickets: 6106
The :class:`_postgresql.ENUM` datatype is PostgreSQL-native and therefore
should not be used with the ``native_enum=False`` flag. This flag is now
ignored if passed to the :class:`_postgresql.ENUM` datatype and a warning
is emitted; previously the flag would cause the type object to fail to
function correctly.
.. change::
:tags: bug, sql
:tickets: 7036
Fixed issue related to new :meth:`_sql.HasCTE.add_cte` feature where
pairing two "INSERT..FROM SELECT" statements simultaneously would lose
track of the two independent SELECT statements, leading to the wrong SQL.
Update aiohttp-oauth2 from 0.0.3 to 0.0.5.
Changelog
### 0.0.5 ``` This fixes when oauth2 resource providers are more technically correct in validating the content-type they receive, specifically for form data. ```Links
- PyPI: https://pypi.org/project/aiohttp-oauth2 - Changelog: https://pyup.io/changelogs/aiohttp-oauth2/ - Repo: https://github.com/mrasband/aiohttp-oauth2Update aiohttp-remotes from 1.0.0 to 1.2.0.
Changelog
### 1.2.0 ``` ================== Bugfixes -------- - Raise a ``HTTPBadRequest`` instead of ``ValueError`` when ``X-Forwarded-For`` header is not a valid IP. (`311 <https://github.com/aio-libs/aiohttp-remotes/issues/311>`_) Deprecations and Removals ------------------------- - Dropped Python 3.6 support, the minimal supported aiohttp is 3.8.1 (`331 <https://github.com/aio-libs/aiohttp-remotes/issues/331>`_) ``` ### 1.1.0 ``` ================== * Added support for Python 3.10 ```Links
- PyPI: https://pypi.org/project/aiohttp-remotes - Changelog: https://pyup.io/changelogs/aiohttp-remotes/ - Repo: https://github.com/aio-libs/aiohttp-remotesUpdate aiohttp from 3.7.4.post0 to 3.8.1.
Changelog
### 3.8.1 ``` ================== Bugfixes -------- - Fix the error in handling the return value of `getaddrinfo`. `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family. It will cause an index out of range error in aiohttp. For example, if user compile CPython with `--disable-ipv6` option, but his system enable the ipv6. `5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_ - Do not install "examples" as a top-level package. `6189 <https://github.com/aio-libs/aiohttp/issues/6189>`_ - Restored ability to connect IPv6-only host. `6195 <https://github.com/aio-libs/aiohttp/issues/6195>`_ - Remove ``Signal`` from ``__all__``, replace ``aiohttp.Signal`` with ``aiosignal.Signal`` in docs `6201 <https://github.com/aio-libs/aiohttp/issues/6201>`_ - Made chunked encoding HTTP header check stricter. `6305 <https://github.com/aio-libs/aiohttp/issues/6305>`_ Improved Documentation ---------------------- - update quick starter demo codes. `6240 <https://github.com/aio-libs/aiohttp/issues/6240>`_ - Added an explanation of how tiny timeouts affect performance to the client reference document. `6274 <https://github.com/aio-libs/aiohttp/issues/6274>`_ - Add flake8-docstrings to flake8 configuration, enable subset of checks. `6276 <https://github.com/aio-libs/aiohttp/issues/6276>`_ - Added information on running complex applications with additional tasks/processes -- :user:`Dreamsorcerer`. `6278 <https://github.com/aio-libs/aiohttp/issues/6278>`_ Misc ---- - `6205 <https://github.com/aio-libs/aiohttp/issues/6205>`_ ---- ``` ### 3.8.0 ``` ================== Features -------- - Added a ``GunicornWebWorker`` feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return ``web.AppRunner`` object. `2988 <https://github.com/aio-libs/aiohttp/issues/2988>`_ - Switch from ``http-parser`` to ``llhttp`` `3561 <https://github.com/aio-libs/aiohttp/issues/3561>`_ - Use Brotli instead of brotlipy `3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_ - Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python mode is significantly slower than compiled one. `3828 <https://github.com/aio-libs/aiohttp/issues/3828>`_ - Make access log use local time with timezone `3853 <https://github.com/aio-libs/aiohttp/issues/3853>`_ - Implemented ``readuntil`` in ``StreamResponse`` `4054 <https://github.com/aio-libs/aiohttp/issues/4054>`_ - FileResponse now supports ETag. `4594 <https://github.com/aio-libs/aiohttp/issues/4594>`_ - Add a request handler type alias ``aiohttp.typedefs.Handler``. `4686 <https://github.com/aio-libs/aiohttp/issues/4686>`_ - ``AioHTTPTestCase`` is more async friendly now. For people who use unittest and are used to use :py:exc:`~unittest.TestCase` it will be easier to write new test cases like the sync version of the :py:exc:`~unittest.TestCase` class, without using the decorator `unittest_run_loop`, just `async def test_*`. The only difference is that for the people using python3.7 and below a new dependency is needed, it is ``asynctestcase``. `4700 <https://github.com/aio-libs/aiohttp/issues/4700>`_ - Add validation of HTTP header keys and values to prevent header injection. `4818 <https://github.com/aio-libs/aiohttp/issues/4818>`_ - Add predicate to ``AbstractCookieJar.clear``. Add ``AbstractCookieJar.clear_domain`` to clean all domain and subdomains cookies only. `4942 <https://github.com/aio-libs/aiohttp/issues/4942>`_ - Add keepalive_timeout parameter to web.run_app. `5094 <https://github.com/aio-libs/aiohttp/issues/5094>`_ - Tracing for client sent headers `5105 <https://github.com/aio-libs/aiohttp/issues/5105>`_ - Make type hints for http parser stricter `5267 <https://github.com/aio-libs/aiohttp/issues/5267>`_ - Add final declarations for constants. `5275 <https://github.com/aio-libs/aiohttp/issues/5275>`_ - Switch to external frozenlist and aiosignal libraries. `5293 <https://github.com/aio-libs/aiohttp/issues/5293>`_ - Don't send secure cookies by insecure transports. By default, the transport is secure if https or wss scheme is used. Use `CookieJar(treat_as_secure_origin="http://127.0.0.1")` to override the default security checker. `5571 <https://github.com/aio-libs/aiohttp/issues/5571>`_ - Always create a new event loop in ``aiohttp.web.run_app()``. This adds better compatibility with ``asyncio.run()`` or if trying to run multiple apps in sequence. `5572 <https://github.com/aio-libs/aiohttp/issues/5572>`_ - Add ``aiohttp.pytest_plugin.AiohttpClient`` for static typing of pytest plugin. `5585 <https://github.com/aio-libs/aiohttp/issues/5585>`_ - Added a ``socket_factory`` argument to ``BaseTestServer``. `5844 <https://github.com/aio-libs/aiohttp/issues/5844>`_ - Add compression strategy parameter to enable_compression method. `5909 <https://github.com/aio-libs/aiohttp/issues/5909>`_ - Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- :user:`Hanaasagi`. `5927 <https://github.com/aio-libs/aiohttp/issues/5927>`_ - Switched ``chardet`` to ``charset-normalizer`` for guessing the HTTP payload body encoding -- :user:`Ousret`. `5930 <https://github.com/aio-libs/aiohttp/issues/5930>`_ - Added optional auto_decompress argument for HttpRequestParser `5957 <https://github.com/aio-libs/aiohttp/issues/5957>`_ - Added support for HTTPS proxies to the extent CPython's :py:mod:`asyncio` supports it -- by :user:`bmbouter`, :user:`jborean93` and :user:`webknjaz`. `5992 <https://github.com/aio-libs/aiohttp/issues/5992>`_ - Added ``base_url`` parameter to the initializer of :class:`~aiohttp.ClientSession`. `6013 <https://github.com/aio-libs/aiohttp/issues/6013>`_ - Add Trove classifier and create binary wheels for 3.10. -- :user:`hugovk`. `6079 <https://github.com/aio-libs/aiohttp/issues/6079>`_ - Started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes — :user:`asvetlov`. `6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_ - Started shipping platform-specific arm64 wheels for Apple Silicon — :user:`asvetlov`. `6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_ Bugfixes -------- - Modify _drain_helper() to handle concurrent `await resp.write(...)` or `ws.send_json(...)` calls without race-condition. `2934 <https://github.com/aio-libs/aiohttp/issues/2934>`_ - Started using `MultiLoopChildWatcher` when it's available under POSIX while setting up the test I/O loop. `3450 <https://github.com/aio-libs/aiohttp/issues/3450>`_ - Only encode content-disposition filename parameter using percent-encoding. Other parameters are encoded to quoted-string or RFC2231 extended parameter value. `4012 <https://github.com/aio-libs/aiohttp/issues/4012>`_ - Fixed HTTP client requests to honor ``no_proxy`` environment variables. `4431 <https://github.com/aio-libs/aiohttp/issues/4431>`_ - Fix supporting WebSockets proxies configured via environment variables. `4648 <https://github.com/aio-libs/aiohttp/issues/4648>`_ - Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations. `4748 <https://github.com/aio-libs/aiohttp/issues/4748>`_ - Ensure a cleanup context is cleaned up even when an exception occurs during startup. `4799 <https://github.com/aio-libs/aiohttp/issues/4799>`_ - Added a new exception type for Unix socket client errors which provides a more useful error message. `4984 <https://github.com/aio-libs/aiohttp/issues/4984>`_ - Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse `5106 <https://github.com/aio-libs/aiohttp/issues/5106>`_ - Only depend on typing_extensions for Python <3.8 `5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_ - Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode `5192 <https://github.com/aio-libs/aiohttp/issues/5192>`_ - Fix cookies disappearing from HTTPExceptions. `5233 <https://github.com/aio-libs/aiohttp/issues/5233>`_ - StaticResource prefixes no longer match URLs with a non-folder prefix. For example ``routes.static('/foo', '/foo')`` no longer matches the URL ``/foobar``. Previously, this would attempt to load the file ``/foo/ar``. `5250 <https://github.com/aio-libs/aiohttp/issues/5250>`_ - Acquire the connection before running traces to prevent race condition. `5259 <https://github.com/aio-libs/aiohttp/issues/5259>`_ - Add missing slots to _RequestContextManager`` and ``_WSRequestContextManager`` `5329 <https://github.com/aio-libs/aiohttp/issues/5329>`_ - Ensure sending a zero byte file does not throw an exception (round 2) `5380 <https://github.com/aio-libs/aiohttp/issues/5380>`_ - Set "text/plain" when data is an empty string in client requests. `5392 <https://github.com/aio-libs/aiohttp/issues/5392>`_ - Stop automatically releasing the ``ClientResponse`` object on calls to the ``ok`` property for the failed requests. `5403 <https://github.com/aio-libs/aiohttp/issues/5403>`_ - Include query parameters from `params` keyword argument in tracing `URL`. `5432 <https://github.com/aio-libs/aiohttp/issues/5432>`_ - Fix annotations `5466 <https://github.com/aio-libs/aiohttp/issues/5466>`_ - Fixed the multipart POST requests processing to always release file descriptors for the ``tempfile.Temporaryfile``-created ``_io.BufferedRandom`` instances of files sent within multipart request bodies via HTTP POST requests -- by :user:`webknjaz`. `5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_ - Fix 0 being incorrectly treated as an immediate timeout. `5527 <https://github.com/aio-libs/aiohttp/issues/5527>`_ - Fixes failing tests when an environment variable <scheme>_proxy is set. `5554 <https://github.com/aio-libs/aiohttp/issues/5554>`_ - Replace deprecated app handler design in ``tests/autobahn/server.py`` with call to ``web.run_app``; replace deprecated ``aiohttp.ws_connect`` calls in ``tests/autobahn/client.py`` with ``aiohttp.ClienSession.ws_connect``. `5606 <https://github.com/aio-libs/aiohttp/issues/5606>`_ - Fixed test for ``HTTPUnauthorized`` that access the ``text`` argument. This is not used in any part of the code, so it's removed now. `5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_ - Remove incorrect default from docs `5727 <https://github.com/aio-libs/aiohttp/issues/5727>`_ - Remove external test dependency to http://httpbin.org `5840 <https://github.com/aio-libs/aiohttp/issues/5840>`_ - Don't cancel current task when entering a cancelled timer. `5853 <https://github.com/aio-libs/aiohttp/issues/5853>`_ - Added ``params`` keyword argument to ``ClientSession.ws_connect``. -- :user:`hoh`. `5868 <https://github.com/aio-libs/aiohttp/issues/5868>`_ - Uses :py:class:`~asyncio.ThreadedChildWatcher` under POSIX to allow setting up test loop in non-main thread. `5877 <https://github.com/aio-libs/aiohttp/issues/5877>`_ - Fix the error in handling the return value of `getaddrinfo`. `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family. It will cause a index out of range error in aiohttp. For example, if user compile CPython with `--disable-ipv6` option but his system enable the ipv6. `5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_ - Removed the deprecated ``loop`` argument from the ``asyncio.sleep``/``gather`` calls `5905 <https://github.com/aio-libs/aiohttp/issues/5905>`_ - Return ``None`` from ``request.if_modified_since``, ``request.if_unmodified_since``, ``request.if_range`` and ``response.last_modified`` when corresponding http date headers are invalid. `5925 <https://github.com/aio-libs/aiohttp/issues/5925>`_ - Fix resetting `SIGCHLD` signals in Gunicorn aiohttp Worker to fix `subprocesses` that capture output having an incorrect `returncode`. `6130 <https://github.com/aio-libs/aiohttp/issues/6130>`_ - Raise ``400: Content-Length can't be present with Transfer-Encoding`` if both ``Content-Length`` and ``Transfer-Encoding`` are sent by peer by both C and Python implementations `6182 <https://github.com/aio-libs/aiohttp/issues/6182>`_ Improved Documentation ---------------------- - Refactored OpenAPI/Swagger aiohttp addons, added ``aio-openapi`` `5326 <https://github.com/aio-libs/aiohttp/issues/5326>`_ - Fixed docs on request cookies type, so it matches what is actually used in the code (a read-only dictionary-like object). `5725 <https://github.com/aio-libs/aiohttp/issues/5725>`_ - Documented that the HTTP client ``Authorization`` header is removed on redirects to a different host or protocol. `5850 <https://github.com/aio-libs/aiohttp/issues/5850>`_ Misc ---- - `3927 <https://github.com/aio-libs/aiohttp/issues/3927>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#5389 <https://github.com/aio-libs/aiohttp/issues/5389>`_, `#5457 <https://github.com/aio-libs/aiohttp/issues/5457>`_, `#5486 <https://github.com/aio-libs/aiohttp/issues/5486>`_, `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_, `#5515 <https://github.com/aio-libs/aiohttp/issues/5515>`_, `#5625 <https://github.com/aio-libs/aiohttp/issues/5625>`_, `#5635 <https://github.com/aio-libs/aiohttp/issues/5635>`_, `#5648 <https://github.com/aio-libs/aiohttp/issues/5648>`_, `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_, `#5890 <https://github.com/aio-libs/aiohttp/issues/5890>`_, `#5914 <https://github.com/aio-libs/aiohttp/issues/5914>`_, `#5932 <https://github.com/aio-libs/aiohttp/issues/5932>`_, `#6002 <https://github.com/aio-libs/aiohttp/issues/6002>`_, `#6045 <https://github.com/aio-libs/aiohttp/issues/6045>`_, `#6131 <https://github.com/aio-libs/aiohttp/issues/6131>`_, `#6156 <https://github.com/aio-libs/aiohttp/issues/6156>`_, `#6165 <https://github.com/aio-libs/aiohttp/issues/6165>`_, `#6166 <https://github.com/aio-libs/aiohttp/issues/6166>`_ ---- ```Links
- PyPI: https://pypi.org/project/aiohttp - Changelog: https://pyup.io/changelogs/aiohttp/ - Repo: https://github.com/aio-libs/aiohttpUpdate aioredis from 1.3.1 to 2.0.1.
Changelog
### 2.0.1 ``` Features - Added Python 3.10 to CI & Updated the Docs (see 1160) - Enable mypy in CI (see 1101) - Synchronized reading the responses from a connection (see 1106) Fixes - Remove __del__ from Redis (Fixes 1115) (see 1227) - fix socket.error raises (see 1129) - Fix buffer is closed error when using PythonParser class (see 1213) ``` ### 2.0.0 ``` Features - Port redis-py's client implementation to aioredis. (see 891) - Make hiredis an optional dependency. (see 917) ```Links
- PyPI: https://pypi.org/project/aioredis - Changelog: https://pyup.io/changelogs/aioredis/ - Repo: https://github.com/aio-libs/aioredis-pyUpdate alembic from 1.5.8 to 1.7.7.
Changelog
### 1.7.5 ``` :include_notes_from: unreleased .. changelog:: ``` ### 1.7.4 ``` :released: October 6, 2021 .. change:: :tags: bug, regression :tickets: 934 Fixed a regression that prevented the use of post write hooks on python version lower than 3.9 .. change:: :tags: bug, environment :tickets: 944 Fixed issue where the :meth:`.MigrationContext.autocommit_block` feature would fail to function when using a SQLAlchemy engine using 2.0 future mode. .. changelog:: ``` ### 1.7.3 ``` :released: September 17, 2021 .. change:: :tags: bug, mypy :tickets: 914 Fixed type annotations for the "constraint_name" argument of operations ``create_primary_key()``, ``create_foreign_key()``. Pull request courtesy TilmanK. .. changelog:: ``` ### 1.7.2 ``` :released: September 17, 2021 .. change:: :tags: bug, typing :tickets: 900 Added missing attributes from context stubs. .. change:: :tags: bug, mypy :tickets: 897 Fixed an import in one of the .pyi files that was triggering an assertion error in some versions of mypy. .. change:: :tags: bug, regression, ops :tickets: 920 Fixed issue where registration of custom ops was prone to failure due to the registration process running ``exec()`` on generated code that as of the 1.7 series includes pep-484 annotations, which in the case of end user code would result in name resolution errors when the exec occurs. The logic in question has been altered so that the annotations are rendered as forward references so that the ``exec()`` can proceed. .. changelog:: ``` ### 1.7.1 ``` :released: August 30, 2021 .. change:: :tags: bug, installation :tickets: 893 Corrected "universal wheel" directive in setup.cfg so that building a wheel does not target Python 2. The PyPi files index for 1.7.0 was corrected manually. Pull request courtesy layday. .. change:: :tags: bug, pep484 :tickets: 895 Fixed issue in generated .pyi files where default values for ``Optional`` arguments were missing, thereby causing mypy to consider them as required. .. change:: :tags: bug, regression, batch :tickets: 896 Fixed regression in batch mode due to :ticket:`883` where the "auto" mode of batch would fail to accommodate any additional migration directives beyond encountering an ``add_column()`` directive, due to a mis-application of the conditional logic that was added as part of this change, leading to "recreate" mode not being used in cases where it is required for SQLite such as for unique constraints. .. changelog:: ``` ### 1.7.0 ``` :released: August 30, 2021 .. change:: :tags: bug, operations :tickets: 879 Fixed regression due to :ticket:`803` where the ``.info`` and ``.comment`` attributes of ``Table`` would be lost inside of the :class:`.DropTableOp` class, which when "reversed" into a :class:`.CreateTableOp` would then have lost these elements. Pull request courtesy Nicolas CANIART. .. change:: :tags: feature, environment :tickets: 842 Enhance ``version_locations`` parsing to handle paths containing spaces. The new configuration option ``version_path_separator`` specifies the character to use when splitting the ``version_locations`` string. The default for new configurations is ``version_path_separator = os``, which will use ``os.pathsep`` (e.g., ``;`` on Windows). .. change:: :tags: installation, changed Alembic 1.7 now supports Python 3.6 and above; support for prior versions including Python 2.7 has been dropped. .. change:: :tags: bug, sqlite, batch :tickets: 883 Batch "auto" mode will now select for "recreate" if the ``add_column()`` operation is used on SQLite, and the column itself meets the criteria for SQLite where ADD COLUMN is not allowed, in this case a functional or parenthesized SQL expression or a ``Computed`` (i.e. generated) column. .. change:: :tags: changed, installation :tickets: 674 Make the ``python-dateutil`` library an optional dependency. This library is only required if the ``timezone`` option is used in the Alembic configuration. An extra require named ``tz`` is available with ``pip install alembic[tz]`` to install it. .. change:: :tags: bug, commands :tickets: 856 Re-implemented the ``python-editor`` dependency as a small internal function to avoid the need for external dependencies. .. change:: :tags: usecase, batch :tickets: 884 Named CHECK constraints are now supported by batch mode, and will automatically be part of the recreated table assuming they are named. They also can be explicitly dropped using ``op.drop_constraint()``. For "unnamed" CHECK constraints, these are still skipped as they cannot be distinguished from the CHECK constraints that are generated by the ``Boolean`` and ``Enum`` datatypes. Note that this change may require adjustments to migrations that drop or rename columns which feature an associated named check constraint, such that an additional ``op.drop_constraint()`` directive should be added for that named constraint as there will no longer be an associated column for it; for the ``Boolean`` and ``Enum`` datatypes, an ``existing_type`` keyword may be passed to ``BatchOperations.drop_constraint`` as well. .. seealso:: :ref:`batch_schematype_constraints` :ref:`batch_check_constraints` .. change:: :tags: changed, installation :tickets: 885 The dependency on ``pkg_resources`` which is part of ``setuptools`` has been removed, so there is no longer any runtime dependency on ``setuptools``. The functionality has been replaced with ``importlib.metadata`` and ``importlib.resources`` which are both part of Python std.lib, or via pypy dependency ``importlib-metadata`` for Python version < 3.8 and ``importlib-resources`` for Python version < 3.9 (while importlib.resources was added to Python in 3.7, it did not include the "files" API until 3.9). .. change:: :tags: feature, tests :tickets: 855 Created a "test suite" similar to the one for SQLAlchemy, allowing developers of third-party dialects to test their code against a set of Alembic tests that have been specially selected to exercise back-end database operations. At the time of release, third-party dialects that have adopted the Alembic test suite to verify compatibility include `CockroachDB <https://pypi.org/project/sqlalchemy-cockroachdb/>`_ and `SAP ASE (Sybase) <https://pypi.org/project/sqlalchemy-sybase/>`_. .. change:: :tags: bug, postgresql :tickets: 874 Fixed issue where usage of the PostgreSQL ``postgresql_include`` option within a :meth:`.Operations.create_index` would raise a KeyError, as the additional column(s) need to be added to the table object used by the construct internally. The issue is equivalent to the SQL Server issue fixed in :ticket:`513`. Pull request courtesy Steven Bronson. .. change:: :tags: feature, general pep-484 type annotations have been added throughout the library. Additionally, stub .pyi files have been added for the "dynamically" generated Alembic modules ``alembic.op`` and ``alembic.config``, which include complete function signatures and docstrings, so that the functions in these namespaces will have both IDE support (vscode, pycharm, etc) as well as support for typing tools like Mypy. The files themselves are statically generated from their source functions within the source tree. .. changelog:: ``` ### 1.6.5 ``` :released: May 27, 2021 .. change:: :tags: bug, autogenerate :tickets: 849 Fixed issue where dialect-specific keyword arguments within the :class:`.DropIndex` operation directive would not render in the autogenerated Python code. As support was improved for adding dialect specific arguments to directives as part of :ticket:`803`, in particular arguments such as "postgresql_concurrently" which apply to the actual create/drop of the index, support was needed for these to render even in a drop index operation. Pull request courtesy Jet Zhou. .. changelog:: ``` ### 1.6.4 ``` :released: May 24, 2021 .. change:: :tags: bug, regression, op directives :tickets: 848 Fixed regression caused by just fixed :ticket:`844` that scaled back the filter for ``unique=True/index=True`` too far such that these directives no longer worked for the ``op.create_table()`` op, this has been fixed. .. changelog:: ``` ### 1.6.3 ``` :released: May 21, 2021 .. change:: :tags: bug, regression, autogenerate :tickets: 844 Fixed 1.6-series regression where ``UniqueConstraint`` and to a lesser extent ``Index`` objects would be doubled up in the generated model when the ``unique=True`` / ``index=True`` flags were used. .. change:: :tags: bug, autogenerate :tickets: 839 Fixed a bug where paths defined in post-write hook options would be wrongly escaped in non posix environment (Windows). .. change:: :tags: bug, regression, versioning :tickets: 843 Fixed regression where a revision file that contained its own down revision as a dependency would cause an endless loop in the traversal logic. .. changelog:: ``` ### 1.6.2 ``` :released: May 6, 2021 .. change:: :tags: bug, versioning, regression :tickets: 839 Fixed additional regression nearly the same as that of :ticket:`838` just released in 1.6.1 but within a slightly different codepath, where "alembic downgrade head" (or equivalent) would fail instead of iterating no revisions. .. changelog:: ``` ### 1.6.1 ``` :released: May 6, 2021 .. change:: :tags: bug, versioning, regression :tickets: 838 Fixed regression in new revisioning traversal where "alembic downgrade base" would fail if the database itself were clean and unversioned; additionally repairs the case where downgrade would fail if attempting to downgrade to the current head that is already present. .. changelog:: ``` ### 1.6.0 ``` :released: May 3, 2021 .. change:: :tags: bug, autogenerate :tickets: 803 Refactored the implementation of :class:`.MigrateOperation` constructs such as :class:`.CreateIndexOp`, :class:`.CreateTableOp`, etc. so that they no longer rely upon maintaining a persistent version of each schema object internally; instead, the state variables of each operation object will be used to produce the corresponding construct when the operation is invoked. The rationale is so that environments which make use of operation-manipulation schemes such as those those discussed in :ref:`autogen_rewriter` are better supported, allowing end-user code to manipulate the public attributes of these objects which will then be expressed in the final output, an example is ``some_create_index_op.kw["postgresql_concurrently"] = True``. Previously, these objects when generated from autogenerate would typically hold onto the original, reflected element internally without honoring the other state variables of each construct, preventing the public API from working. .. change:: :tags: bug, environment :tickets: 829 Fixed regression caused by the SQLAlchemy 1.4/2.0 compatibility switch where calling ``.rollback()`` or ``.commit()`` explicitly within the ``context.begin_transaction()`` context manager would cause it to fail when the block ended, as it did not expect that the transaction was manually closed. .. change:: :tags: bug, autogenerate :tickets: 827 Improved the rendering of ``op.add_column()`` operations when adding multiple columns to an existing table, so that the order of these statements matches the order in which the columns were declared in the application's table metadata. Previously the added columns were being sorted alphabetically. .. change:: :tags: feature, autogenerate :tickets: 819 Fix the documentation regarding the default command-line argument position of the revision script filename within the post-write hook arguments. Implement a ``REVISION_SCRIPT_FILENAME`` token, enabling the position to be changed. Switch from ``str.split()`` to ``shlex.split()`` for more robust command-line argument parsing. .. change:: :tags: feature :tickets: 822 Implement a ``.cwd`` (current working directory) suboption for post-write hooks (of type ``console_scripts``). This is useful for tools like pre-commit, which rely on the working directory to locate the necessary config files. Add pre-commit as an example to the documentation. Minor change: rename some variables from ticket 819 to improve readability. .. change:: :tags: bug, versioning :tickets: 765, 464 The algorithm used for calculating downgrades/upgrades/iterating revisions has been rewritten, to resolve ongoing issues of branches not being handled consistently particularly within downgrade operations, as well as for overall clarity and maintainability. This change includes that a deprecation warning is emitted if an ambiguous command such as "downgrade -1" when multiple heads are present is given. In particular, the change implements a long-requested use case of allowing downgrades of a single branch to a branchpoint. Huge thanks to Simon Bowly for their impressive efforts in successfully tackling this very difficult problem. .. change:: :tags: bug, batch :tickets: 799 Added missing ``batch_op.create_table_comment()``, ``batch_op.drop_table_comment()`` directives to batch ops. .. changelog:: ```Links
- PyPI: https://pypi.org/project/alembic - Changelog: https://pyup.io/changelogs/alembic/ - Homepage: https://alembic.sqlalchemy.org - Docs: https://pythonhosted.org/alembic/Update apscheduler from 3.7.0 to 3.9.1.
Changelog
### 3.8.1 ``` - Allowed the use of tzlocal v4.0+ in addition to v2.* ``` ### 3.8.0 ``` - Allowed passing through keyword arguments to the underlying stdlib executors in the thread/process pool executors (PR by Albert Xu) ```Links
- PyPI: https://pypi.org/project/apscheduler - Changelog: https://pyup.io/changelogs/apscheduler/ - Repo: https://github.com/agronholm/apscheduler - Docs: https://pythonhosted.org/APScheduler/Update marshmallow from 3.11.1 to 3.15.0.
Changelog
### 3.15.0 ``` ******************* Features: - Allow passing a `dict` to `fields.Nested` (:pr:`1935`). Thanks :user:`sirosen` for the PR. Other changes: - Address distutils deprecation warning in Python 3.10 (:pr:`1903`). Thanks :user:`kkirsche` for the PR. - Add py310 to black target-version (:pr:`1921`). - Drop support for Python 3.6 (:pr:`1923`). - Use postponed evaluation of annotations (:pr:`1932`). Thanks :user:`Isira-Seneviratne` for the PR. ``` ### 3.14.1 ``` ******************* Bug fixes: - Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_ (:pr:`1905`). Thanks :user:`bwindsor` for the catch and patch. ``` ### 3.14.0 ``` ******************* Bug fixes: - Fix ``fields.TimeDelta`` serialization precision (:issue:`1865`). Thanks :user:`yarsanich` for reporting. Other changes: - Fix type-hints for data arg in Schema.validate to accept list of dictionaries (:issue:`1790`, :pr:`1868`). Thanks :user:`yourun-proger` for PR. - Improve warning when passing metadata as keyword arguments (:pr:`1882`). Thanks :user:`traherom` for the PR. - Don't build universal wheels. We don't support Python 2 anymore. (:issue:`1860`) Thanks :user:`YKdvd` for reporting. - Make the build reproducible (:pr:`1862`). - Drop support for Python 3.5 (:pr:`1863`). - Test against Python 3.10 (:pr:`1888`). ``` ### 3.13.0 ``` ******************* Features: - Replace ``missing``/``default`` field parameters with ``load_default``/``dump_default`` (:pr:`1742`). Thanks :user:`sirosen` for the PR. Deprecations: - The use of ``missing``/``default`` field parameters is deprecated and will be removed in marshmallow 4. ``load_default``/``dump_default`` should be used instead. ``` ### 3.12.2 ``` ******************* Bug fixes: - Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change introduced in 3.12.0 that causes issues when field names conflict with ``Schema`` attributes or methods. ``Fields``\s are still accessible on a ``Schema`` instance through the ``fields`` attribute. (:pr:`1843`) ``` ### 3.12.1 ``` ******************* Bug fixes: - Fix bug that raised an ``AttributeError`` when instantiating a ``Schema`` with a field named ``parent`` (:issue:`1808`). Thanks :user:`flying-sheep` for reporting and helping with the fix. ``` ### 3.12.0 ``` ******************* Features: - Add ``validate.And`` (:issue:`1768`). Thanks :user:`rugleb` for the suggestion. - Add type annotations to ``marshmallow.decorators`` (:issue:`1788`, :pr:`1789`). Thanks :user:`michaeldimchuk` for the PR. - Let ``Field``\s be accessed by name as ``Schema`` attributes (:pr:`1631`). Other changes: - Improve types in ``marshmallow.validate`` (:pr:`1786`). - Make ``marshmallow.validate.Validator`` an abstract base class (:pr:`1786`). - Remove unnecessary list cast (:pr:`1785`). ```Links
- PyPI: https://pypi.org/project/marshmallow - Changelog: https://pyup.io/changelogs/marshmallow/ - Repo: https://github.com/marshmallow-code/marshmallowUpdate sentry-sdk from 1.0.0 to 1.5.10.
The bot wasn't able to find a changelog for this release. Got an idea?
Links
- PyPI: https://pypi.org/project/sentry-sdk - Repo: https://github.com/getsentry/sentry-pythonUpdate psycopg2-binary from 2.8.6 to 2.9.3.
The bot wasn't able to find a changelog for this release. Got an idea?
Links
- PyPI: https://pypi.org/project/psycopg2-binary - Homepage: https://psycopg.org/Update pyyaml from 5.4.1 to 6.0.
The bot wasn't able to find a changelog for this release. Got an idea?
Links
- PyPI: https://pypi.org/project/pyyaml - Homepage: https://pyyaml.org/Update uvloop from 0.15.2 to 0.16.0.
Changelog
### 0.16.0 ``` This release adds Python 3.10 support, updates bundled libuv to 1.42.0 and fixes a handful of issues. Changes ======= * Python 3.10 support (432) (by elprans in 2519e2df for 432) * Bump vendored libuv to 1.42.0 (433) (by elprans in a62f7818 for 433) * Use cibuildwheel to build wheels (435) (by elprans in 20febe0b for 435) * Add support for `<timer handle>.when()` (by Jens Jorgensen in 62b2af9c) Fixes ===== * Fix ref issue when protocol is in Cython (by fantix in 70cafc82 for 2222) * Set `python_requires` in setup.py (by graingert in c808a663) * SSL: schedule first data after waiter wakeup (by fantix in 2081db89) * Fix a possible race condition in sslproto test (by fantix in b0526cd5 for 412) * Fix `call_soon_threadsafe` thread safety (by fantix in 4b803b15) ``` ### 0.15.3 ``` Bug Fixes * SSL: schedule first data after waiter wakeup (by fantix in 0df12282) * Fix a possible race condition in sslproto test (by fantix in 2e71c4c2 for 412) * Fix `call_soon_threadsafe` thread safety (by fantix and hehaha in 6387a4e4 for 408) ```Links
- PyPI: https://pypi.org/project/uvloop - Changelog: https://pyup.io/changelogs/uvloop/ - Repo: http://github.com/MagicStack/uvloopUpdate sqlalchemy from 1.3.23 to 1.4.35.
Changelog
### 1.4.27 ``` :include_notes_from: unreleased_14 .. changelog:: ``` ### 1.4.26 ``` :released: October 19, 2021 .. change:: :tags: orm :tickets: 6284 Passing a :class:`.Query` object to :meth:`_orm.Session.execute` is not the intended use of this object, and will now raise a deprecation warning. .. change:: :tags: bug, postgresql :tickets: 5387 Added a "disconnect" condition for the "SSL SYSCALL error: Bad address" error message as reported by psycopg2. Pull request courtesy Zeke Brechtel. .. change:: :tags: bug, orm Improved the exception message generated when configuring a mapping with joined table inheritance where the two tables either have no foreign key relationships set up, or where they have multiple foreign key relationships set up. The message is now ORM specific and includes context that the :paramref:`_orm.Mapper.inherit_condition` parameter may be needed particularly for the ambiguous foreign keys case. .. change:: :tags: bug, sql :tickets: 6520 Fixed issue where SQL queries using the :meth:`_functions.FunctionElement.within_group` construct could not be pickled, typically when using the ``sqlalchemy.ext.serializer`` extension but also for general generic pickling. .. change:: :tags: bug, orm :tickets: 7189 Fixed issue with :func:`_orm.with_loader_criteria` feature where ON criteria would not be added to a JOIN for a query of the form ``select(A).join(B)``, stating a target while making use of an implicit ON clause. .. change:: :tags: bug, orm :tickets: 7205 Fixed bug where the ORM "plugin", necessary for features such as :func:`_orm.with_loader_criteria` to work correctly, would not be applied to a :func:`_sql.select` which queried from an ORM column expression if it made use of the :meth:`_sql.ColumnElement.label` modifier. .. change:: :tags: bug, mypy :tickets: 6435 Fixed issue in mypy plugin to improve upon some issues detecting ``Enum()`` SQL types containing custom Python enumeration classes. Pull request courtesy Hiroshi Ogawa. .. change:: :tags: bug, mysql :tickets: 7144 Fixed issue in MySQL :func:`_mysql.match` construct where passing a clause expression such as :func:`_sql.bindparam` or other SQL expression for the "against" parameter would fail. Pull request courtesy Anton Kovalevich. .. change:: :tags: bug, mssql :tickets: 7160 Fixed issue with :meth:`.Inspector.get_foreign_keys` where foreign keys were omitted if they were established against a unique index instead of a unique constraint. .. change:: :tags: usecase, mssql Added reflection support for SQL Server foreign key options, including "ON UPDATE" and "ON DELETE" values of "CASCADE" and "SET NULL". .. change:: :tags: bug, sql :tickets: 4123 Repaired issue in new :paramref:`_sql.HasCTE.cte.nesting` parameter introduced with :ticket:`4123` where a recursive :class:`_sql.CTE` using :paramref:`_sql.HasCTE.cte.recursive` in typical conjunction with UNION would not compile correctly. Additionally makes some adjustments so that the :class:`_sql.CTE` construct creates a correct cache key. Pull request courtesy Eric Masseran. .. change:: :tags: bug, engine :tickets: 7130 Fixed issue where the deprecation warning for the :class:`.URL` constructor which indicates that the :meth:`.URL.create` method should be used would not emit if a full positional argument list of seven arguments were passed; additionally, validation of URL arguments will now occur if the constructor is called in this way, which was being skipped previously. .. change:: :tags: bug, orm :tickets: 7103 Add missing methods added in :ticket:`6991` to :class:`_scoping.scoped_session` and :func:`_asyncio.async_scoped_session`. .. change:: :tags: bug, examples :tickets: 7169 Repaired the examples in examples/versioned_rows to use SQLAlchemy 1.4 APIs correctly; these examples had been missed when API changes like removing "passive" from :meth:`_orm.Session.is_modified` were made as well as the :meth:`_ormevents.SessionEvents.do_orm_execute()` event hook were added. .. change:: :tags: bug, orm :tickets: 6974, 6972 An extra layer of warning messages has been added to the functionality of :meth:`_orm.Query.join` and the ORM version of :meth:`_sql.Select.join`, where a few places where "automatic aliasing" continues to occur will now be called out as a pattern to avoid, mostly specific to the area of joined table inheritance where classes that share common base tables are being joined together without using explicit aliases. One case emits a legacy warning for a pattern that's not recommended, the other case is fully deprecated. The automatic aliasing within ORM join() which occurs for overlapping mapped tables does not work consistently with all APIs such as :func:`_orm.contains_eager()`, and rather than continue to try to make these use cases work everywhere, replacing with a more user-explicit pattern is clearer, less prone to bugs and simplifies SQLAlchemy's internals further. The warnings include links to the errors.rst page where each pattern is demonstrated along with the recommended pattern to fix. .. seealso:: :ref:`error_xaj1` :ref:`error_xaj2` .. change:: :tags: bug, sql :tickets: 7061 Account for the :paramref:`_sql.table.schema` parameter passed to the :func:`_sql.table` construct, such that it is taken into account when accessing the :attr:`_sql.TableClause.fullname` attribute. .. change:: :tags: bug, sql :tickets: 7140 Fixed an inconsistency in the :meth:`_sql.ColumnOperators.any_` / :meth:`_sql.ColumnOperators.all_` functions / methods where the special behavior these functions have of "flipping" the expression such that the "ANY" / "ALL" expression is always on the right side would not function if the comparison were against the None value, that is, "column.any_() == None" should produce the same SQL expression as "null() == column.any_()". Added more docs to clarify this as well, plus mentions that any_() / all_() generally supersede the ARRAY version "any()" / "all()". .. change:: :tags: engine, bug, postgresql :tickets: 3247 The :meth:`_reflection.Inspector.reflect_table` method now supports reflecting tables that do not have user defined columns. This allows :meth:`_schema.MetaData.reflect` to properly complete reflection on databases that contain such tables. Currently, only PostgreSQL is known to support such a construct among the common database backends. .. change:: :tags: sql, bug, regression :tickets: 7177 Fixed issue where "expanding IN" would fail to function correctly with datatypes that use the :meth:`_types.TypeEngine.bind_expression` method, where the method would need to be applied to each element of the IN expression rather than the overall IN expression itself. .. change:: :tags: postgresql, bug, regression :tickets: 7177 Fixed issue where IN expressions against a series of array elements, as can be done with PostgreSQL, would fail to function correctly due to multiple issues within the "expanding IN" feature of SQLAlchemy Core that was standardized in version 1.4. The psycopg2 dialect now makes use of the :meth:`_types.TypeEngine.bind_expression` method with :class:`_types.ARRAY` to portably apply the correct casts to elements. The asyncpg dialect was not affected by this issue as it applies bind-level casts at the driver level rather than at the compiler level. .. change:: :tags: bug, mysql :tickets: 7204 Fixed installation issue where the ``sqlalchemy.dialects.mysql`` module would not be importable if "greenlet" were not installed. .. change:: :tags: bug, mssql :tickets: 7168 Fixed issue with :meth:`.Inspector.has_table` where it would return False if a local temp table with the same name from a different session happened to be returned first when querying tempdb. This is a continuation of :ticket:`6910` which accounted for the temp table existing only in the alternate session and not the current one. .. change:: :tags: bug, orm :tickets: 7128 Fixed bug where iterating a :class:`.Result` from a :class:`_orm.Session` after that :class:`_orm.Session` were closed would partially attach objects to that session in an essentially invalid state. It now raises an exception with a link to new documentation if an **un-buffered** result is iterated from a :class:`_orm.Session` that was closed or otherwise had the :meth:`_orm.Session.expunge_all` method called after that :class:`.Result` was generated. The ``prebuffer_rows`` execution option, as is used automatically by the asyncio extension for client-side result sets, may be used to produce a :class:`.Result` where the ORM objects are prebuffered, and in this case iterating the result will produce a series of detached objects. .. seealso:: :ref:`error_lkrp` .. change:: :tags: bug, mssql, regression :tickets: 7129 Fixed bug in SQL Server :class:`_mssql.DATETIMEOFFSET` datatype where the ODBC implementation would not generate the correct DDL, for cases where the type were converted using the ``dialect.type_descriptor()`` method, the usage of which is illustrated in some documented examples for :class:`.TypeDecorator`, though not necessary for most datatypes. Regression was introduced by :ticket:`6366`. As part of this change, the full list of SQL Server date types have been amended to return a "dialect impl" that generates the same DDL name as the supertype. .. change:: :tags: bug, sql :tickets: 7153 Adjusted the "column disambiguation" logic that's new in 1.4, where the same expression repeated gets an "extra anonymous" label, so that the logic more aggressively deduplicates those labels when the repeated element is the same Python expression object each time, as occurs in cases like when using "singleton" values like :func:`_sql.null`. This is based on the observation that at least some databases (e.g. MySQL, but not SQLite) will raise an error if the same label is repeated inside of a subquery. .. change:: :tags: bug, orm :tickets: 7154 Related to :ticket:`7153`, fixed an issue where result column lookups would fail for "adapted" SELECT statements that selected for "constant" value expressions most typically the NULL expression, as would occur in such places as joined eager loading in conjunction with limit/offset. This was overall a regression due to issue :ticket:`6259` which removed all "adaption" for constants like NULL, "true", and "false" when rewriting expressions in a SQL statement, but this broke the case where the same adaption logic were used to resolve the constant to a labeled expression for the purposes of result set targeting. .. change:: :tags: bug, orm, regression :tickets: 7134 Fixed regression where ORM loaded objects could not be pickled in cases where loader options making use of ``"*"`` were used in certain combinations, such as combining the :func:`_orm.joinedload` loader strategy with ``raiseload('*')`` of sub-elements. .. change:: :tags: bug, engine :tickets: 7077 Implemented proper ``__reduce__()`` methods for all SQLAlchemy exception objects to ensure they all support clean round trips when pickling, as exception objects are often serialized for the purposes of various debugging tools. .. change:: :tags: bug, orm, regression :tickets: 7209 Fixed regression where the use of a :class:`_hybrid.hybrid_property` attribute or a mapped :func:`_orm.composite` attribute as a key passed to the :meth:`_dml.Update.values` method for an ORM-enabled :class:`_dml.Update` statement, as well as when using it via the legacy :meth:`_orm.Query.update` method, would be processed for incoming ORM/hybrid/composite values within the compilation stage of the UPDATE statement, which meant that in those cases where caching occurred, subsequent invocations of the same statement would no longer receive the correct values. This would include not only hybrids that use the :meth:`_hybrid.hybrid_property.update_expression` method, but any use of a plain hybrid attribute as well. For composites, the issue instead caused a non-repeatable cache key to be generated, which would break caching and could fill up the statement cache with repeated statements. The :class:`_dml.Update` construct now handles the processing of key/value pairs passed to :meth:`_dml.Update.values` and :meth:`_dml.Update.ordered_values` up front when the construct is first generated, before the cache key has been generated so that the key/value pairs are processed each time, and so that the cache key is generated against the individual column/value pairs that will ultimately be used in the statement. .. changelog:: ``` ### 1.4.25 ``` :released: September 22, 2021 .. change:: :tags: bug, platform, regression :tickets: 7024 Fixed regression due to :ticket:`7024` where the reorganization of the "platform machine" names used by the ``greenlet`` dependency mis-spelled "aarch64" and additionally omitted uppercase "AMD64" as is needed for Windows machines. Pull request courtesy James Dow. .. changelog:: ``` ### 1.4.24 ``` :released: September 22, 2021 .. change:: :tags: bug, asyncio :tickets: 6943 Fixed a bug in :meth:`_asyncio.AsyncSession.execute` and :meth:`_asyncio.AsyncSession.stream` that required ``execution_options`` to be an instance of ``immutabledict`` when defined. It now correctly accepts any mapping. .. change:: :tags: engine, asyncio, usecase :tickets: 6832 Improve the interface used by adapted drivers, like the asyncio ones, to access the actual connection object returned by the driver. The :class:`._ConnectionFairy` object has two new attributes: * :attr:`._ConnectionFairy.dbapi_connection` always represents a DBAPI compatible object. For pep-249 drivers, this is the DBAPI connection as it always has been, previously accessed under the ``.connection`` attribute. For asyncio drivers that SQLAlchemy adapts into a pep-249 interface, the returned object will normally be a SQLAlchemy adaption object called :class:`_engine.AdaptedConnection`. * :attr:`._ConnectionFairy.driver_connection` always represents the actual connection object maintained by the third party pep-249 DBAPI or async driver in use. For standard pep-249 DBAPIs, this will always be the same object as that of the ``dbapi_connection``. For an asyncio driver, it will be the underlying asyncio-only connection object. The ``.connection`` attribute remains available and is now a legacy alias of ``.dbapi_connection``. .. seealso:: :ref:`faq_dbapi_connection` .. change:: :tags: bug, sql :tickets: 7052 Implemented missing methods in :class:`_functions.FunctionElement` which, while unused, would lead pylint to report them as unimplemented abstract methods. .. change:: :tags: bug, mssql, reflection :tickets: 6910 Fixed an issue where :meth:`_reflection.has_table` returned ``True`` for local temporary tables that actually belonged to a different SQL Server session (connection). An extra check is now performed to ensure that the temp table detected is in fact owned by the current session. .. change:: :tags: bug, engine, regression :tickets: 6913 Fixed issue where the ability of the :meth:`_events.ConnectionEvents.before_execute` method to alter the SQL statement object passed, returning the new object to be invoked, was inadvertently removed. This behavior has been restored. .. change:: :tags: bug, engine :tickets: 6958 Ensure that ``str()`` is called on the an :paramref:`_url.URL.create.password` argument, allowing usage of objects that implement the ``__str__()`` method as password attributes. Also clarified that one such object is not appropriate to dynamically change the password for each database connection; the approaches at :ref:`engines_dynamic_tokens` should be used instead. .. change:: :tags: bug, orm, regression :tickets: 6979 Fixed ORM issue where column expressions passed to ``query()`` or ORM-enabled ``select()`` would be deduplicated on the identity of the object, such as a phrase like ``select(A.id, null(), null())`` would produce only one "NULL" expression, which previously was not the case in 1.3. However, the change also allows for ORM expressions to render as given as well, such as ``select(A.data, A.data)`` will produce a result row with two columns. .. change:: :tags: bug, engine :tickets: 6983 Fixed issue in :class:`_engine.URL` where validation of "drivername" would not appropriately respond to the ``None`` value where a string were expected. .. change:: :tags: bug, mypy :tickets: 6950 Fixed issue where mypy plugin would crash when interpreting a ``query_expression()`` construct. .. change:: :tags: usecase, sql :tickets: 4123 Added new parameter :paramref:`_sql.HasCTE.cte.nesting` to the :class:`_sql.CTE` constructor and :meth:`_sql.HasCTE.cte` method, which flags the CTE as one which should remain nested within an enclosing CTE, rather than being moved to the top level of the outermost SELECT. While in the vast majority of cases there is no difference in SQL functionality, users have identified various edge-cases where true nesting of CTE constructs is desirable. Much thanks to Eric Masseran for lots of work on this intricate feature. .. change:: :tags: usecase, engine, orm :tickets: 6990 Added new methods :meth:`_orm.Session.scalars`, :meth:`_engine.Connection.scalars`, :meth:`_asyncio.AsyncSession.scalars` and :meth:`_asyncio.AsyncSession.stream_scalars`, which provide a short cut to the use case of receiving a row-oriented :class:`_result.Result` object and converting it to a :class:`_result.ScalarResult` object via the :meth:`_engine.Result.scalars` method, to return a list of values rather than a list of rows. The new methods are analogous to the long existing :meth:`_orm.Session.scalar` and :meth:`_engine.Connection.scalar` methods used to return a single value from the first row only. Pull request courtesy Miguel Grinberg. .. change:: :tags: usecase, orm :tickets: 6955 Added loader options to :meth:`_orm.Session.merge` and :meth:`_asyncio.AsyncSession.merge` via a new :paramref:`_orm.Session.merge.options` parameter, which will apply the given loader options to the ``get()`` used internally by merge, allowing eager loading of relationships etc. to be applied when the merge process loads a new object. Pull request courtesy Daniel Stone. .. change:: :tags: feature, asyncio, mysql :tickets: 6993 Added initial support for the ``asyncmy`` asyncio database driver for MySQL and MariaDB. This driver is very new, however appears to be the only current alternative to the ``aiomysql`` driver which currently appears to be unmaintained and is not working with current Python versions. Much thanks to long2ice for the pull request for this dialect. .. seealso:: :ref:`asyncmy` .. change:: :tags: bug, asyncio Added missing ``**kw`` arguments to the :meth:`_asyncio.AsyncSession.connection` method. .. change:: :tags: bug, sql :tickets: 7055 Fixed a two issues where combinations of ``select()`` and ``join()`` when adapted to form a copy of the element would not completely copy the state of all column objects associated with subqueries. A key problem this caused is that usage of the :meth:`_sql.ClauseElement.params` method (which should probably be moved into a legacy category as it is inefficient and error prone) would leave copies of the old :class:`_sql.BindParameter` objects around, leading to issues in correctly setting the parameters at execution time. .. change:: :tags: bug, orm, regression :tickets: 6924 Fixed issue in recently repaired ``Query.with_entities()`` method where the flag that determines automatic uniquing for legacy ORM ``Query`` objects only would be set to ``True`` inappropriately in cases where the ``with_entities()`` call would be setting the ``Query`` to return column-only rows, which are not uniqued. .. change:: :tags: bug, postgresql :tickets: 6912 Qualify ``version()`` call to avoid shadowing issues if a different search path is configured by the user. .. change:: :tags: bug, engine, postgresql :tickets: 6963 Fixed issue where an engine that had :paramref:`_sa.create_engine.implicit_returning` set to False would fail to function when PostgreSQL's "fast insertmany" feature were used in conjunction with a ``Sequence``, as well as if any kind of "executemany" with "return_defaults()" were used in conjunction with a ``Sequence``. Note that PostgreSQL "fast insertmany" uses "RETURNING" by definition, when the SQL statement is passed to the driver; overall, the :paramref:`_sa.create_engine.implicit_returning` flag is legacy and has no real use in modern SQLAlchemy, and will be deprecated in a separate change. .. change:: :tags: bug, mypy :tickets: 6937 Fixed issue in mypy plugin where columns on a mixin would not be correctly interpreted if the mapped class relied upon a ``__tablename__`` routine that came from a superclass. .. change:: :tags: bug, postgresql :tickets: 6106 The :class:`_postgresql.ENUM` datatype is PostgreSQL-native and therefore should not be used with the ``native_enum=False`` flag. This flag is now ignored if passed to the :class:`_postgresql.ENUM` datatype and a warning is emitted; previously the flag would cause the type object to fail to function correctly. .. change:: :tags: bug, sql :tickets: 7036 Fixed issue related to new :meth:`_sql.HasCTE.add_cte` feature where pairing two "INSERT..FROM SELECT" statements simultaneously would lose track of the two independent SELECT statements, leading to the wrong SQL.