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
### 3.9.1
```
* Removed a leftover check for pytz ``localize()`` and ``normalize()`` methods
```
### 3.9.0
```
- Added support for PySide6 to the Qt scheduler
- No longer enforce pytz time zones (support for others is experimental in the 3.x series)
- Fixed compatibility with PyMongo 4
- Fixed pytz deprecation warnings
- Fixed RuntimeError when shutting down the scheduler from a scheduled job
```
### 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.19.0
```
*******************
Features:
- Add ``timestamp`` and ``timestamp_ms`` formats to `fields.DateTime`
(:issue:`612`).
Thanks :user:`vgavro` for the suggestion and thanks :user:`vanHoi` for
the PR.
```
### 3.18.0
```
*******************
Features:
- Add ``Enum`` field (:pr:`2017`) and (:pr:`2044`).
Bug fixes:
- Fix typing in ``Field._serialize`` signature (:pr:`2046`).
```
### 3.17.1
```
*******************
Bug fixes:
- Add return type to ``fields.Email.__init__`` (:pr:`2018`).
Thanks :user:`kkirsche` for the PR.
- Add missing type hint to IPInterface __init__ (:pr:`2036`).
```
### 3.17.0
```
*******************
Features:
- Support serialization as float in ``TimeDelta`` field (:pr:`1998`).
Thanks :user:`marcosatti` for the PR.
- Add ``messages_dict`` property to ``ValidationError`` to facilitate type checking
(:pr:`1976`).
Thanks :user:`sirosen` for the PR.
```
### 3.16.0
```
*******************
Features:
- Raise ``ValueError`` if an invalid value is passed to the ``unknown``
argument (:issue:`1721`, :issue:`1732`).
Thanks :user:`sirosen` for the PR.
Other changes:
- Set lower bound for ``packaging`` requirement (:issue:`1957`).
Thanks :user:`MatthewNicolTR` for reporting and thanks :user:`sirosen` for the PR.
- Improve warning messages by passing ``stacklevel`` (:pr:`1986`).
Thanks :user:`tirkarthi` for the PR.
```
### 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.17.0
```
This release adds Python 3.11 support, updates bundled libuv to 1.43.0
and fixes a handful of issues.
Changes
=======
* Expose uv_loop_t pointer for integration with other C-extensions (310)
(by pranavtbhat in b332eb85 for 310)
* Support python 3.11+ (473)
(by zeroday0619 in 8e42921d for 473)
* Expose libuv uv_fs_event functionality (474)
(by jensbjorgensen fantix in 74d381e8 for 474)
* Activate debug mode when `-X dev` is used
(by jack1142 in 637a77a3)
* Expose uv_version() for libuv API compatibility (491)
(by fantix in 089f6cbf for 491)
* Fix loop.getaddrinfo() and tests (495)
(by fantix in 598b16fd for 495)
* Bump to libuv 1.43.0
(by fantix in 94e5e535)
Fixes
=====
* _TransProtPair is no longer defined in asyncio.events
(by jensbjorgensen in fae5f7fb)
* use a TypeVar for asyncio.BaseProtocol (478)
(by graingert in 3aacb352 for 478)
* Fix segfault in TimerHandle.when() after cleared
(by jensbjorgensen in c39afff8 for 469)
* Avoid self._errpipe_write double close (466)
(by graingert in 72140d7e for 466)
* Fix typo in test (456)
(by kianmeng in 033d52d0 for 456)
* Fix potential infinite loop (446)
(by kfur in ada43c06 for 446)
* use a stack of self._fds_to_close to prevent double closes (481)
(by graingert in 3214cf68 for 481)
* Fix incorrect main thread id value forking from a thread (453)
(by horpto fantix in e7934c88 for 453)
* create_subprocess_exec should treat env={} as empty environment (439) (454)
(by byllyfish in e04637e0 for 439)
* Queue write only after processing all buffers (445)
(by jakirkham fantix in 9c6ecb62 for 445)
* Drop Python 3.6 support for thread ident
(by fantix in 9c37930e)
* bugfix: write to another transport in resume_writing() fails (498)
(by fantix in d2deffef for 498)
Build
=====
* Upgrade GitHub Actions (477) (480)
(by cclauss in fcbf422d for 477, 10086942 for 480)
* typo `same as same`
(by YoSTEALTH in fedba80a)
* setup.py: allow to override extra_compile_args (443)
(by giuliobenetti in a130375f for 443)
* Drop hack in setup.py in finalize_options (492)
(by fantix in 2f1bc83c for 492)
* Fix tests invocation on release CI worklow (489)
(by ben9923 in d6a2b597 for 489)
Documentation
=============
* use asyncio.Runner loop_factory on 3.11+ (472)
(by graingert in 31ba48ca for 472)
* Fix CI badge in docs, remove remaining Travis CI references from docs
(by Nothing4You in c6901a74)
* Fix typo in README
(by monosans in 73d7253b)
```
### 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
### 2.0.0rc3
```
:released: January 18, 2023
.. change::
:tags: bug, typing
:tickets: 9096
Fixes to the annotations within the ``sqlalchemy.ext.hybrid`` extension for
more effective typing of user-defined methods. The typing now uses
:pep:`612` features, now supported by recent versions of Mypy, to maintain
argument signatures for :class:`.hybrid_method`. Return values for hybrid
methods are accepted as SQL expressions in contexts such as
:meth:`_sql.Select.where` while still supporting SQL methods.
.. change::
:tags: bug, orm
:tickets: 9099
Fixed issue where using a pep-593 ``Annotated`` type in the
:paramref:`_orm.registry.type_annotation_map` which itself contained a
generic plain container or ``collections.abc`` type (e.g. ``list``,
``dict``, ``collections.abc.Sequence``, etc. ) as the target type would
produce an internal error when the ORM were trying to interpret the
``Annotated`` instance.
.. change::
:tags: bug, orm
:tickets: 9100
Added an error message when a :func:`_orm.relationship` is mapped against
an abstract container type, such as ``Mapped[Sequence[B]]``, without
providing the :paramref:`_orm.relationship.container_class` parameter which
is necessary when the type is abstract. Previously the the abstract
container would attempt to be instantiated at a later step and fail.
.. change::
:tags: orm, feature
:tickets: 9060
Added a new parameter to :class:`_orm.Mapper` called
:paramref:`_orm.Mapper.polymorphic_abstract`. The purpose of this directive
is so that the ORM will not consider the class to be instantiated or loaded
directly, only subclasses. The actual effect is that the
:class:`_orm.Mapper` will prevent direct instantiation of instances
of the class and will expect that the class does not have a distinct
polymorphic identity configured.
In practice, the class that is mapped with
:paramref:`_orm.Mapper.polymorphic_abstract` can be used as the target of a
:func:`_orm.relationship` as well as be used in queries; subclasses must of
course include polymorphic identities in their mappings.
The new parameter is automatically applied to classes that subclass
the :class:`.AbstractConcreteBase` class, as this class is not intended
to be instantiated.
.. seealso::
:ref:`orm_inheritance_abstract_poly`
.. change::
:tags: bug, postgresql
:tickets: 9106
Fixed regression where psycopg3 changed an API call as of version 3.1.8 to
expect a specific object type that was previously not enforced, breaking
connectivity for the psycopg3 dialect.
.. change::
:tags: oracle, usecase
:tickets: 9086
Added support for the Oracle SQL type ``TIMESTAMP WITH LOCAL TIME ZONE``,
using a newly added Oracle-specific :class:`_oracle.TIMESTAMP` datatype.
.. changelog::
```
### 2.0.0rc2
```
:released: January 9, 2023
.. change::
:tags: bug, typing
:tickets: 9067
The Data Class Transforms argument ``field_descriptors`` was renamed
to ``field_specifiers`` in the accepted version of PEP 681.
.. change::
:tags: bug, oracle
:tickets: 9059
Supported use case for foreign key constraints where the local column is
marked as "invisible". The errors normally generated when a
:class:`.ForeignKeyConstraint` is created that check for the target column
are disabled when reflecting, and the constraint is skipped with a warning
in the same way which already occurs for an :class:`.Index` with a similar
issue.
.. change::
:tags: bug, orm
:tickets: 9071
Fixed issue where an overly restrictive ORM mapping rule were added in 2.0
which prevented mappings against :class:`.TableClause` objects, such as
those used in the view recipe on the wiki.
.. change::
:tags: bug, mysql
:tickets: 9058
Restored the behavior of :meth:`.Inspector.has_table` to report on
temporary tables for MySQL / MariaDB. This is currently the behavior for
all other included dialects, but was removed for MySQL in 1.4 due to no
longer using the DESCRIBE command; there was no documented support for temp
tables being reported by the :meth:`.Inspector.has_table` method in this
version or on any previous version, so the previous behavior was undefined.
As SQLAlchemy 2.0 has added formal support for temp table status via
:meth:`.Inspector.has_table`, the MySQL /MariaDB dialect has been reverted
to use the "DESCRIBE" statement as it did in the SQLAlchemy 1.3 series and
previously, and test support is added to include MySQL / MariaDB for
this behavior. The previous issues with ROLLBACK being emitted which
1.4 sought to improve upon don't apply in SQLAlchemy 2.0 due to
simplifications in how :class:`.Connection` handles transactions.
DESCRIBE is necessary as MariaDB in particular has no consistently
available public information schema of any kind in order to report on temp
tables other than DESCRIBE/SHOW COLUMNS, which rely on throwing an error
in order to report no results.
.. change::
:tags: json, postgresql
:tickets: 7147
Implemented missing ``JSONB`` operations:
* ` using :meth:`_postgresql.JSONB.Comparator.path_match`
* ``?`` using :meth:`_postgresql.JSONB.Comparator.path_exists`
* ``-`` using :meth:`_postgresql.JSONB.Comparator.delete_path`
Pull request curtesy of Guilherme Martins Crocetti.
.. changelog::
```
### 2.0.0rc1
```
:released: December 28, 2022
.. change::
:tags: bug, typing
:tickets: 6810, 9025
pep-484 typing has been completed for the
``sqlalchemy.ext.horizontal_shard`` extension as well as the
``sqlalchemy.orm.events`` module. Thanks to Gleb Kisenkov for their
efforts.
.. change::
:tags: postgresql, bug
:tickets: 8977
:versions: 2.0.0rc1
Added support for explicit use of PG full text functions with asyncpg and
psycopg (SQLAlchemy 2.0 only), with regards to the ``REGCONFIG`` type cast
for the first argument, which previously would be incorrectly cast to a
VARCHAR, causing failures on these dialects that rely upon explicit type
casts. This includes support for :class:`_postgresql.to_tsvector`,
:class:`_postgresql.to_tsquery`, :class:`_postgresql.plainto_tsquery`,
:class:`_postgresql.phraseto_tsquery`,
:class:`_postgresql.websearch_to_tsquery`,
:class:`_postgresql.ts_headline`, each of which will determine based on
number of arguments passed if the first string argument should be
interpreted as a PostgreSQL "REGCONFIG" value; if so, the argument is typed
using a newly added type object :class:`_postgresql.REGCONFIG` which is
then explicitly cast in the SQL expression.
.. change::
:tags: bug, orm
:tickets: 4629
A warning is emitted if a backref name used in :func:`_orm.relationship`
names an attribute on the target class which already has a method or
attribute assigned to that name, as the backref declaration will replace
that attribute.
.. change::
:tags: bug, postgresql
:tickets: 9020
Fixed regression where newly revised PostgreSQL range types such as
:class:`_postgresql.INT4RANGE` could not be set up as the impl of a
:class:`.TypeDecorator` custom type, instead raising a ``TypeError``.
.. change::
:tags: usecase, orm
:tickets: 7837
Adjustments to the :class:`_orm.Session` in terms of extensibility,
as well as updates to the :class:`.ShardedSession` extension:
* :meth:`_orm.Session.get` now accepts
:paramref:`_orm.Session.get.bind_arguments`, which in particular may be
useful when using the horizontal sharding extension.
* :meth:`_orm.Session.get_bind` accepts arbitrary kw arguments, which
assists in developing code that uses a :class:`_orm.Session` class which
overrides this method with additional arguments.
* Added a new ORM execution option ``identity_token`` which may be used
to directly affect the "identity token" that will be associated with
newly loaded ORM objects. This token is how sharding approaches
(namely the :class:`.ShardedSession`, but can be used in other cases
as well) separate object identities across different "shards".
.. seealso::
:ref:`queryguide_identity_token`
* The :meth:`_orm.SessionEvents.do_orm_execute` event hook may now be used
to affect all ORM-related options, including ``autoflush``,
``populate_existing``, and ``yield_per``; these options are re-consumed
subsequent to event hooks being invoked before they are acted upon.
Previously, options like ``autoflush`` would have been already evaluated
at this point. The new ``identity_token`` option is also supported in
this mode and is now used by the horizontal sharding extension.
* The :class:`.ShardedSession` class replaces the
:paramref:`.ShardedSession.id_chooser` hook with a new hook
:paramref:`.ShardedSession.identity_chooser`, which no longer relies upon
the legacy :class:`_orm.Query` object.
:paramref:`.ShardedSession.id_chooser` is still accepted in place of
:paramref:`.ShardedSession.identity_chooser` with a deprecation warning.
.. change::
:tags: usecase, orm
:tickets: 9015
The behavior of "joining an external transaction into a Session" has been
revised and improved, allowing explicit control over how the
:class:`_orm.Session` will accommodate an incoming
:class:`_engine.Connection` that already has a transaction and possibly a
savepoint already established. The new parameter
:paramref:`_orm.Session.join_transaction_mode` includes a series of option
values which can accommodate the existing transaction in several ways, most
importantly allowing a :class:`_orm.Session` to operate in a fully
transactional style using savepoints exclusively, while leaving the
externally initiated transaction non-committed and active under all
circumstances, allowing test suites to rollback all changes that take place
within tests.
Additionally, revised the :meth:`_orm.Session.close` method to fully close
out savepoints that may still be present, which also allows the
"external transaction" recipe to proceed without warnings if the
:class:`_orm.Session` did not explicitly end its own SAVEPOINT
transactions.
.. seealso::
:ref:`change_9015`
.. change::
:tags: bug, sql
:tickets: 8988
Added test support to ensure that all compiler ``visit_xyz()`` methods
across all :class:`.Compiler` implementations in SQLAlchemy accept a
``**kw`` parameter, so that all compilers accept additional keyword
arguments under all circumstances.
.. change::
:tags: bug, postgresql
:tickets: 8984
The :meth:`_postgresql.Range.__eq___` will now return ``NotImplemented``
when comparing with an instance of a different class, instead of raising
an :exc:`AttributeError` exception.
.. change::
:tags: bug, sql
:tickets: 6114
The :meth:`.SQLCompiler.construct_params` method, as well as the
:attr:`.SQLCompiler.params` accessor, will now return the
exact parameters that correspond to a compiled statement that used
the ``render_postcompile`` parameter to compile. Previously,
the method returned a parameter structure that by itself didn't correspond
to either the original parameters or the expanded ones.
Passing a new dictionary of parameters to
:meth:`.SQLCompiler.construct_params` for a :class:`.SQLCompiler` that was
constructed with ``render_postcompile`` is now disallowed; instead, to make
a new SQL string and parameter set for an alternate set of parameters, a
new method :meth:`.SQLCompiler.construct_expanded_state` is added which
will produce a new expanded form for the given parameter set, using the
:class:`.ExpandedState` container which includes a new SQL statement
and new parameter dictionary, as well as a positional parameter tuple.
.. change::
:tags: bug, orm
:tickets: 8703, 8997, 8996
A series of changes and improvements regarding
:meth:`_orm.Session.refresh`. The overall change is that primary key
attributes for an object are now included in a refresh operation
unconditionally when relationship-bound attributes are to be refreshed,
even if not expired and even if not specified in the refresh.
* Improved :meth:`_orm.Session.refresh` so that if autoflush is enabled
(as is the default for :class:`_orm.Session`), the autoflush takes place
at an earlier part of the refresh process so that pending primary key
changes are applied without errors being raised. Previously, this
autoflush took place too late in the process and the SELECT statement
would not use the correct key to locate the row and an
:class:`.InvalidRequestError` would be raised.
* When the above condition is present, that is, unflushed primary key
changes are present on the object, but autoflush is not enabled,
the refresh() method now explicitly disallows the operation to proceed,
and an informative :class:`.InvalidRequestError` is raised asking that
the pending primary key changes be flushed first. Previously,
this use case was simply broken and :class:`.InvalidRequestError`
would be raised anyway. This restriction is so that it's safe for the
primary key attributes to be refreshed, as is necessary for the case of
being able to refresh the object with relationship-bound secondary
eagerloaders also being emitted. This rule applies in all cases to keep
API behavior consistent regardless of whether or not the PK cols are
actually needed in the refresh, as it is unusual to be refreshing
some attributes on an object while keeping other attributes "pending"
in any case.
* The :meth:`_orm.Session.refresh` method has been enhanced such that
attributes which are :func:`_orm.relationship`-bound and linked to an
eager loader, either at mapping time or via last-used loader options,
will be refreshed in all cases even when a list of attributes is passed
that does not include any columns on the parent row. This builds upon the
feature first implemented for non-column attributes as part of
:ticket:`1763` fixed in 1.4 allowing eagerly-loaded relationship-bound
attributes to participate in the :meth:`_orm.Session.refresh` operation.
If the refresh operation does not indicate any columns on the parent row
to be refreshed, the primary key columns will nonetheless be included
in the refresh operation, which allows the load to proceed into the
secondary relationship loaders indicated as it does normally.
Previously an :class:`.InvalidRequestError` error would be raised
for this condition (:ticket:`8703`)
* Fixed issue where an unnecessary additional SELECT would be emitted in
the case where :meth:`_orm.Session.refresh` were called with a
combination of expired attributes, as well as an eager loader such as
:func:`_orm.selectinload` that emits a "secondary" query, if the primary
key attributes were also in an expired state. As the primary key
attributes are now included in the refresh automatically, there is no
additional load for these attributes when a relationship loader
goes to select for them (:ticket:`8997`)
* Fixed regression caused by :ticket:`8126` released in 2.0.0b1 where the
:meth:`_orm.Session.refresh` method would fail with an
``AttributeError``, if passed both an expired column name as well as the
name of a relationship-bound attribute that was linked to a "secondary"
eagerloader such as the :func:`_orm.selectinload` eager loader
(:ticket:`8996`)
.. change::
:tags: bug, sql
:tickets: 8994
To accommodate for third party dialects with different character escaping
needs regarding bound parameters, the system by which SQLAlchemy "escapes"
(i.e., replaces with another character in its place) special characters in
bound parameter names has been made extensible for third party dialects,
using the :attr:`.SQLCompiler.bindname_escape_chars` dictionary which can
be overridden at the class declaration level on any :class:`.SQLCompiler`
subclass. As part of this change, also added the dot ``"."`` as a default
"escaped" character.
.. change::
:tags: orm, feature
:tickets: 8889
Added a new default value for the :paramref:`.Mapper.eager_defaults`
parameter "auto", which will automatically fetch table default values
during a unit of work flush, if the dialect supports RETURNING for the
INSERT being run, as well as
:ref:`insertmanyvalues <engine_insertmanyvalues>` available. Eager fetches
for server-side UPDATE defaults, which are very uncommon, continue to only
take place if :paramref:`.Mapper.eager_defaults` is set to ``True``, as
there is no batch-RETURNING form for UPDATE statements.
.. change::
:tags: usecase, orm
:tickets: 8973
Removed the requirement that the ``__allow_unmapped__`` attribute be used
on Declarative Dataclass Mapped class when non-``Mapped[]`` annotations are
detected; previously, an error message that was intended to support legacy
ORM typed mappings would be raised, which additionally did not mention
correct patterns to use with Dataclasses specifically. This error message
is now no longer raised if :meth:`_orm.registry.mapped_as_dataclass` or
:class:`_orm.MappedAsDataclass` is used.
.. seealso::
:ref:`orm_declarative_native_dataclasses_non_mapped_fields`
.. change::
:tags: bug, orm
:tickets: 8168
Improved a fix first made in version 1.4 for :ticket:`8456` which scaled
back the usage of internal "polymorphic adapters", that are used to render
ORM queries when the :paramref:`_orm.Mapper.with_polymorphic` parameter is
used. These adapters, which are very complex and error prone, are now used
only in those cases where an explicit user-supplied subquery is used for
:paramref:`_orm.Mapper.with_polymorphic`, which includes only the use case
of concrete inheritance mappings that use the
:func:`_orm.polymorphic_union` helper, as well as the legacy use case of
using an aliased subquery for joined inheritance mappings, which is not
needed in modern use.
For the most common case of joined inheritance mappings that use the
built-in polymorphic loading scheme, which includes those which make use of
the :paramref:`_orm.Mapper.polymorphic_load` parameter set to ``inline``,
polymorphic adapters are now no longer used. This has both a positive
performance impact on the construction of queries as well as a
substantial simplification of the internal query rendering process.
The specific issue targeted was to allow a :func:`_orm.column_property`
to refer to joined-inheritance classes within a scalar subquery, which now
works as intuitively as is feasible.
.. changelog::
```
### 2.0.0b4
```
:released: December 5, 2022
.. change::
:tags: usecase, orm
:tickets: 8859
Added support custom user-defined types which extend the Python
``enum.Enum`` base class to be resolved automatically
to SQLAlchemy :class:`.Enum` SQL types, when using the Annotated
Declarative Table feature. The feature is made possible through new
lookup features added to the ORM type map feature, and includes support
for changing the arguments of the :class:`.Enum` that's generated by
default as well as setting up specific ``enum.Enum`` types within
the map with specific arguments.
.. seealso::
:ref:`orm_declarative_mapped_column_enums`
.. change::
:tags: bug, typing
:tickets: 8783
Adjusted internal use of the Python ``enum.IntFlag`` class which changed
its behavioral contract in Python 3.11. This was not causing runtime
failures however caused typing runs to fail under Python 3.11.
.. change::
:tags: usecase, typing
:tickets: 8847
Added a new type :class:`.SQLColumnExpression` which may be indicated in
user code to represent any SQL column oriented expression, including both
those based on :class:`.ColumnElement` as well as on ORM
:class:`.QueryableAttribute`. This type is a real class, not an alias, so
can also be used as the foundation for other objects. An additional
ORM-specific subclass :class:`.SQLORMExpression` is also included.
.. change::
:tags: bug, typing
:tickets: 8667, 6810
The ``sqlalchemy.ext.mutable`` extension and ``sqlalchemy.ext.automap``
extensions are now fully pep-484 typed. Huge thanks to Gleb Kisenkov for
their efforts on this.
.. change::
:tags: bug, sql
:tickets: 8849
The approach to the ``numeric`` pep-249 paramstyle has been rewritten, and
is now fully supported, including by features such as "expanding IN" and
"insertmanyvalues". Parameter names may also be repeated in the source SQL
construct which will be correctly represented within the numeric format
using a single parameter. Introduced an additional numeric paramstyle
called ``numeric_dollar``, which is specifically what's used by the asyncpg
dialect; the paramstyle is equivalent to ``numeric`` except numeric
indicators are indicated by a dollar-sign rather than a colon. The asyncpg
dialect now uses ``numeric_dollar`` paramstyle directly, rather than
compiling to ``format`` style first.
The ``numeric`` and ``numeric_dollar`` paramstyles assume that the target
backend is capable of receiving the numeric parameters in any order,
and will match the given parameter values to the statement based on
matching their position (1-based) to the numeric indicator. This is the
normal behavior of "numeric" paramstyles, although it was observed that
the SQLite DBAPI implements a not-used "numeric" style that does not honor
parameter ordering.
.. change::
:tags: usecase, postgresql
:tickets: 8765
Complementing :ticket:`8690`, new comparison methods such as
:meth:`_postgresql.Range.adjacent_to`,
:meth:`_postgresql.Range.difference`, :meth:`_postgresql.Range.union`,
etc., were added to the PG-specific range objects, bringing them in par
with the standard operators implemented by the underlying
:attr:`_postgresql.AbstractRange.comparator_factory`.
In addition, the ``__bool__()`` method of the class has been corrected to
be consistent with the common Python containers behavior as well as how
other popular PostgreSQL drivers do: it now tells whether the range
instance is *not* empty, rather than the other way around.
Pull request courtesy Lele Gaifax.
.. change::
:tags: bug, sql
:tickets: 8770
Adjusted the rendering of ``RETURNING``, in particular when using
:class:`_sql.Insert`, such that it now renders columns using the same logic
as that of the :class:`.Select` construct to generate labels, which will
include disambiguating labels, as well as that a SQL function surrounding a
named column will be labeled using the column name itself. This establishes
better cross-compatibility when selecting rows from either :class:`.Select`
constructs or from DML statements that use :meth:`.UpdateBase.returning`. A
narrower scale change was also made for the 1.4 series that adjusted the
function label issue only.
.. change::
:tags: change, postgresql, asyncpg
:tickets: 8926
Changed the paramstyle used by asyncpg from ``format`` to
``numeric_dollar``. This has two main benefits since it does not require
additional processing of the statement and allows for duplicate parameters
to be present in the statements.
.. change::
:tags: bug, orm
:tickets: 8888
Fixed issue where use of an unknown datatype within a :class:`.Mapped`
annotation for a column-based attribute would silently fail to map the
attribute, rather than reporting an exception; an informative exception
message is now raised.
.. change::
:tags: bug, orm
:tickets: 8777
Fixed a suite of issues involving :class:`.Mapped` use with dictionary
types, such as ``Mapped[dict[str, str] | None]``, would not be correctly
interpreted in Declarative ORM mappings. Support to correctly
"de-optionalize" this type including for lookup in ``type_annotation_map``
has been fixed.
.. change::
:tags: feature, orm
:tickets: 8822
Added a new parameter :paramref:`_orm.mapped_column.use_existing_column` to
accommodate the use case of a single-table inheritance mapping that uses
the pattern of more than one subclass indicating the same column to take
place on the superclass. This pattern was previously possible by using
:func:`_orm.declared_attr` in conjunction with locating the existing column
in the ``.__table__`` of the superclass, however is now updated to work
with :func:`_orm.mapped_column` as well as with pep-484 typing, in a
simple and succinct way.
.. seealso::
:ref:`orm_inheritance_column_conflicts`
.. change::
:tags: bug, mssql
:tickets: 8917
Fixed regression caused by the combination of :ticket:`8177`, re-enable
setinputsizes for SQL server unless fast_executemany + DBAPI executemany is
used for a statement, along with :ticket:`6047`, implement
"insertmanyvalues", which bypasses DBAPI executemany in place of a custom
DBAPI execute for INSERT statements. setinputsizes would incorrectly not be
used for a multiple parameter-set INSERT statement that used
"insertmanyvalues" if fast_executemany were turned on, as the check would
incorrectly assume this is a DBAPI executemany call. The "regression"
would then be that the "insertmanyvalues" statement format is apparently
slightly more sensitive to multiple rows that don't use the same types
for each row, so in such a case setinputsizes is especially needed.
The fix repairs the fast_executemany check so that it only disables
setinputsizes if true DBAPI executemany is to be used.
.. change::
:tags: bug, orm, performance
:tickets: 8796
Additional performance enhancements within ORM-enabled SQL statements,
specifically targeting callcounts within the construction of ORM
statements, using combinations of :func:`_orm.aliased` with
:func:`_sql.union` and similar "compound" constructs, in addition to direct
performance improvements to the ``corresponding_column()`` internal method
that is used heavily by the ORM by constructs like :func:`_orm.aliased` and
similar.
.. change::
:tags: bug, postgresql
:tickets: 8884
Added additional type-detection for the new PostgreSQL
:class:`_postgresql.Range` type, where previous cases that allowed the
psycopg2-native range objects to be received directly by the DBAPI without
SQLAlchemy intercepting them stopped working, as we now have our own value
object. The :class:`_postgresql.Range` object has been enhanced such that
SQLAlchemy Core detects it in otherwise ambiguous situations (such as
comparison to dates) and applies appropriate bind handlers. Pull request
courtesy Lele Gaifax.
.. change::
:tags: bug, orm
:tickets: 8880
Fixed bug in :ref:`orm_declarative_native_dataclasses` feature where using
plain dataclass fields with the ``__allow_unmapped__`` directive in a
mapping would not create a dataclass with the correct class-level state for
those fields, copying the raw ``Field`` object to the class inappropriately
after dataclasses itself had replaced the ``Field`` object with the
class-level default value.
.. change::
:tags: usecase, orm extensions
:tickets: 8878
Added support for the :func:`.association_proxy` extension function to
take part within Python ``dataclasses`` configuration, when using
the native dataclasses feature described at
:ref:`orm_declarative_native_dataclasses`. Included are attribute-level
arguments including :paramref:`.association_proxy.init` and
:paramref:`.association_proxy.default_factory`.
Documentation for association proxy has also been updated to use
"Annotated Declarative Table" forms within examples, including type
annotations used for :class:`.AssocationProxy` itself.
.. change::
:tags: bug, typing
Corrected typing support for the :paramref:`_orm.relationship.secondary`
argument which may also accept a callable (lambda) that returns a
:class:`.FromClause`.
.. change::
:tags: bug, orm, regression
:tickets: 8812
Fixed regression where flushing a mapped class that's mapped against a
subquery, such as a direct mapping or some forms of concrete table
inheritance, would fail if the :paramref:`_orm.Mapper.eager_defaults`
parameter were used.
.. change::
:tags: bug, schema
:tickets: 8925
Stricter rules are in place for appending of :class:`.Column` objects to
:class:`.Table` objects, both moving some previous deprecation warnings to
exceptions, and preventing some previous scenarios that would cause
duplicate columns to appear in tables, when
:paramref:`.Table.extend_existing` were set to ``True``, for both
programmatic :class:`.Table` construction as well as during reflection
operations.
See :ref:`change_8925` for a rundown of these changes.
.. seealso::
:ref:`change_8925`
.. change::
:tags: usecase, orm
:tickets: 8905
Added :paramref:`_orm.mapped_column.compare` parameter to relevant ORM
attribute constructs including :func:`_orm.mapped_column`,
:func:`_orm.relationship` etc. to provide for the Python dataclasses
``compare`` parameter on ``field()``, when using the
:ref:`orm_declarative_native_dataclasses` feature. Pull request courtesy
Simon Schiele.
.. change::
:tags: sql, usecase
:tickets: 6289
Added :class:`_expression.ScalarValues` that can be used as a column
element allowing using :class:`_expression.Values` inside ``IN`` clauses
or in conjunction with ``ANY`` or ``ALL`` collection aggregates.
This new class is generated using the method
:meth:`_expression.Values.scalar_values`.
The :class:`_expression.Values` instance is now coerced to a
:class:`_expression.ScalarValues` when used in a ``IN`` or ``NOT IN``
operation.
.. change::
:tags: bug, orm
:tickets: 8853
Fixed regression in 2.0.0b3 caused by :ticket:`8759` where indicating the
:class:`.Mapped` name using a qualified name such as
``sqlalchemy.orm.Mapped`` would fail to be recognized by Declarative as
indicating the :class:`.Mapped` construct.
.. change::
:tags: bug, typing
:tickets: 8842
Improved the typing for :class:`.sessionmaker` and
:class:`.async_sessionmaker`, so that the default type of their return value
will be :class:`.Session` or :class:`.AsyncSession`, without the need to
type this explicitly. Previously, Mypy would not automaticaly infer these
return types from its generic base.
As part of this change, arguments for :class:`.Session`,
:class:`.AsyncSession`, :class:`.sessionmaker` and
:class:`.async_sessionmaker` beyond the initial "bind" argument have been
made keyword-only, which includes parameters that have always been
documented as keyword arguments, such as :paramref:`.Session.autoflush`,
:paramref:`.Session.class_`, etc.
Pull request courtesy Sam Bull.
.. change::
:tags: bug, typing
:tickets: 8776
Fixed issue where passing a callbale function returning an iterable
of column elements to :paramref:`_orm.relationship.order_by` was
flagged as an error in type checkers.
.. changelog::
```
### 2.0.0b3
```
:released: November 4, 2022
.. change::
:tags: bug, orm, declarative
:tickets: 8759
Added support in ORM declarative annotations for class names specified for
:func:`_orm.relationship`, as well as the name of the :class:`_orm.Mapped`
symbol itself, to be different names than their direct class name, to
support scenarios such as where :class:`_orm.Mapped` is imported as
``from sqlalchemy.orm import Mapped as M``, or where related class names
are imported with an alternate name in a similar fashion. Additionally, a
target class name given as the lead argument for :func:`_orm.relationship`
will always supersede the name given in the left hand annotation, so that
otherwise un-importable names th
Update aiohttp-jinja2 from 1.5 to 1.5.1.
The bot wasn't able to find a changelog for this release. Got an idea?
Links
- PyPI: https://pypi.org/project/aiohttp-jinja2 - Changelog: https://pyup.io/changelogs/aiohttp-jinja2/ - Repo: https://github.com/aio-libs/aiohttp_jinja2/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.3.
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.9.2.
The bot wasn't able to find a changelog for this release. Got an idea?
Links
- PyPI: https://pypi.org/project/alembic - Homepage: https://alembic.sqlalchemy.org - Docs: https://pythonhosted.org/alembic/Update apscheduler from 3.7.0 to 3.10.0.
Changelog
### 3.9.1 ``` * Removed a leftover check for pytz ``localize()`` and ``normalize()`` methods ``` ### 3.9.0 ``` - Added support for PySide6 to the Qt scheduler - No longer enforce pytz time zones (support for others is experimental in the 3.x series) - Fixed compatibility with PyMongo 4 - Fixed pytz deprecation warnings - Fixed RuntimeError when shutting down the scheduler from a scheduled job ``` ### 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.19.0.
Changelog
### 3.19.0 ``` ******************* Features: - Add ``timestamp`` and ``timestamp_ms`` formats to `fields.DateTime` (:issue:`612`). Thanks :user:`vgavro` for the suggestion and thanks :user:`vanHoi` for the PR. ``` ### 3.18.0 ``` ******************* Features: - Add ``Enum`` field (:pr:`2017`) and (:pr:`2044`). Bug fixes: - Fix typing in ``Field._serialize`` signature (:pr:`2046`). ``` ### 3.17.1 ``` ******************* Bug fixes: - Add return type to ``fields.Email.__init__`` (:pr:`2018`). Thanks :user:`kkirsche` for the PR. - Add missing type hint to IPInterface __init__ (:pr:`2036`). ``` ### 3.17.0 ``` ******************* Features: - Support serialization as float in ``TimeDelta`` field (:pr:`1998`). Thanks :user:`marcosatti` for the PR. - Add ``messages_dict`` property to ``ValidationError`` to facilitate type checking (:pr:`1976`). Thanks :user:`sirosen` for the PR. ``` ### 3.16.0 ``` ******************* Features: - Raise ``ValueError`` if an invalid value is passed to the ``unknown`` argument (:issue:`1721`, :issue:`1732`). Thanks :user:`sirosen` for the PR. Other changes: - Set lower bound for ``packaging`` requirement (:issue:`1957`). Thanks :user:`MatthewNicolTR` for reporting and thanks :user:`sirosen` for the PR. - Improve warning messages by passing ``stacklevel`` (:pr:`1986`). Thanks :user:`tirkarthi` for the PR. ``` ### 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.14.0.
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.5.
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.17.0.
Changelog
### 0.17.0 ``` This release adds Python 3.11 support, updates bundled libuv to 1.43.0 and fixes a handful of issues. Changes ======= * Expose uv_loop_t pointer for integration with other C-extensions (310) (by pranavtbhat in b332eb85 for 310) * Support python 3.11+ (473) (by zeroday0619 in 8e42921d for 473) * Expose libuv uv_fs_event functionality (474) (by jensbjorgensen fantix in 74d381e8 for 474) * Activate debug mode when `-X dev` is used (by jack1142 in 637a77a3) * Expose uv_version() for libuv API compatibility (491) (by fantix in 089f6cbf for 491) * Fix loop.getaddrinfo() and tests (495) (by fantix in 598b16fd for 495) * Bump to libuv 1.43.0 (by fantix in 94e5e535) Fixes ===== * _TransProtPair is no longer defined in asyncio.events (by jensbjorgensen in fae5f7fb) * use a TypeVar for asyncio.BaseProtocol (478) (by graingert in 3aacb352 for 478) * Fix segfault in TimerHandle.when() after cleared (by jensbjorgensen in c39afff8 for 469) * Avoid self._errpipe_write double close (466) (by graingert in 72140d7e for 466) * Fix typo in test (456) (by kianmeng in 033d52d0 for 456) * Fix potential infinite loop (446) (by kfur in ada43c06 for 446) * use a stack of self._fds_to_close to prevent double closes (481) (by graingert in 3214cf68 for 481) * Fix incorrect main thread id value forking from a thread (453) (by horpto fantix in e7934c88 for 453) * create_subprocess_exec should treat env={} as empty environment (439) (454) (by byllyfish in e04637e0 for 439) * Queue write only after processing all buffers (445) (by jakirkham fantix in 9c6ecb62 for 445) * Drop Python 3.6 support for thread ident (by fantix in 9c37930e) * bugfix: write to another transport in resume_writing() fails (498) (by fantix in d2deffef for 498) Build ===== * Upgrade GitHub Actions (477) (480) (by cclauss in fcbf422d for 477, 10086942 for 480) * typo `same as same` (by YoSTEALTH in fedba80a) * setup.py: allow to override extra_compile_args (443) (by giuliobenetti in a130375f for 443) * Drop hack in setup.py in finalize_options (492) (by fantix in 2f1bc83c for 492) * Fix tests invocation on release CI worklow (489) (by ben9923 in d6a2b597 for 489) Documentation ============= * use asyncio.Runner loop_factory on 3.11+ (472) (by graingert in 31ba48ca for 472) * Fix CI badge in docs, remove remaining Travis CI references from docs (by Nothing4You in c6901a74) * Fix typo in README (by monosans in 73d7253b) ``` ### 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 2.0.1.
Changelog
### 2.0.0rc3 ``` :released: January 18, 2023 .. change:: :tags: bug, typing :tickets: 9096 Fixes to the annotations within the ``sqlalchemy.ext.hybrid`` extension for more effective typing of user-defined methods. The typing now uses :pep:`612` features, now supported by recent versions of Mypy, to maintain argument signatures for :class:`.hybrid_method`. Return values for hybrid methods are accepted as SQL expressions in contexts such as :meth:`_sql.Select.where` while still supporting SQL methods. .. change:: :tags: bug, orm :tickets: 9099 Fixed issue where using a pep-593 ``Annotated`` type in the :paramref:`_orm.registry.type_annotation_map` which itself contained a generic plain container or ``collections.abc`` type (e.g. ``list``, ``dict``, ``collections.abc.Sequence``, etc. ) as the target type would produce an internal error when the ORM were trying to interpret the ``Annotated`` instance. .. change:: :tags: bug, orm :tickets: 9100 Added an error message when a :func:`_orm.relationship` is mapped against an abstract container type, such as ``Mapped[Sequence[B]]``, without providing the :paramref:`_orm.relationship.container_class` parameter which is necessary when the type is abstract. Previously the the abstract container would attempt to be instantiated at a later step and fail. .. change:: :tags: orm, feature :tickets: 9060 Added a new parameter to :class:`_orm.Mapper` called :paramref:`_orm.Mapper.polymorphic_abstract`. The purpose of this directive is so that the ORM will not consider the class to be instantiated or loaded directly, only subclasses. The actual effect is that the :class:`_orm.Mapper` will prevent direct instantiation of instances of the class and will expect that the class does not have a distinct polymorphic identity configured. In practice, the class that is mapped with :paramref:`_orm.Mapper.polymorphic_abstract` can be used as the target of a :func:`_orm.relationship` as well as be used in queries; subclasses must of course include polymorphic identities in their mappings. The new parameter is automatically applied to classes that subclass the :class:`.AbstractConcreteBase` class, as this class is not intended to be instantiated. .. seealso:: :ref:`orm_inheritance_abstract_poly` .. change:: :tags: bug, postgresql :tickets: 9106 Fixed regression where psycopg3 changed an API call as of version 3.1.8 to expect a specific object type that was previously not enforced, breaking connectivity for the psycopg3 dialect. .. change:: :tags: oracle, usecase :tickets: 9086 Added support for the Oracle SQL type ``TIMESTAMP WITH LOCAL TIME ZONE``, using a newly added Oracle-specific :class:`_oracle.TIMESTAMP` datatype. .. changelog:: ``` ### 2.0.0rc2 ``` :released: January 9, 2023 .. change:: :tags: bug, typing :tickets: 9067 The Data Class Transforms argument ``field_descriptors`` was renamed to ``field_specifiers`` in the accepted version of PEP 681. .. change:: :tags: bug, oracle :tickets: 9059 Supported use case for foreign key constraints where the local column is marked as "invisible". The errors normally generated when a :class:`.ForeignKeyConstraint` is created that check for the target column are disabled when reflecting, and the constraint is skipped with a warning in the same way which already occurs for an :class:`.Index` with a similar issue. .. change:: :tags: bug, orm :tickets: 9071 Fixed issue where an overly restrictive ORM mapping rule were added in 2.0 which prevented mappings against :class:`.TableClause` objects, such as those used in the view recipe on the wiki. .. change:: :tags: bug, mysql :tickets: 9058 Restored the behavior of :meth:`.Inspector.has_table` to report on temporary tables for MySQL / MariaDB. This is currently the behavior for all other included dialects, but was removed for MySQL in 1.4 due to no longer using the DESCRIBE command; there was no documented support for temp tables being reported by the :meth:`.Inspector.has_table` method in this version or on any previous version, so the previous behavior was undefined. As SQLAlchemy 2.0 has added formal support for temp table status via :meth:`.Inspector.has_table`, the MySQL /MariaDB dialect has been reverted to use the "DESCRIBE" statement as it did in the SQLAlchemy 1.3 series and previously, and test support is added to include MySQL / MariaDB for this behavior. The previous issues with ROLLBACK being emitted which 1.4 sought to improve upon don't apply in SQLAlchemy 2.0 due to simplifications in how :class:`.Connection` handles transactions. DESCRIBE is necessary as MariaDB in particular has no consistently available public information schema of any kind in order to report on temp tables other than DESCRIBE/SHOW COLUMNS, which rely on throwing an error in order to report no results. .. change:: :tags: json, postgresql :tickets: 7147 Implemented missing ``JSONB`` operations: * ` using :meth:`_postgresql.JSONB.Comparator.path_match` * ``?`` using :meth:`_postgresql.JSONB.Comparator.path_exists` * ``-`` using :meth:`_postgresql.JSONB.Comparator.delete_path` Pull request curtesy of Guilherme Martins Crocetti. .. changelog:: ``` ### 2.0.0rc1 ``` :released: December 28, 2022 .. change:: :tags: bug, typing :tickets: 6810, 9025 pep-484 typing has been completed for the ``sqlalchemy.ext.horizontal_shard`` extension as well as the ``sqlalchemy.orm.events`` module. Thanks to Gleb Kisenkov for their efforts. .. change:: :tags: postgresql, bug :tickets: 8977 :versions: 2.0.0rc1 Added support for explicit use of PG full text functions with asyncpg and psycopg (SQLAlchemy 2.0 only), with regards to the ``REGCONFIG`` type cast for the first argument, which previously would be incorrectly cast to a VARCHAR, causing failures on these dialects that rely upon explicit type casts. This includes support for :class:`_postgresql.to_tsvector`, :class:`_postgresql.to_tsquery`, :class:`_postgresql.plainto_tsquery`, :class:`_postgresql.phraseto_tsquery`, :class:`_postgresql.websearch_to_tsquery`, :class:`_postgresql.ts_headline`, each of which will determine based on number of arguments passed if the first string argument should be interpreted as a PostgreSQL "REGCONFIG" value; if so, the argument is typed using a newly added type object :class:`_postgresql.REGCONFIG` which is then explicitly cast in the SQL expression. .. change:: :tags: bug, orm :tickets: 4629 A warning is emitted if a backref name used in :func:`_orm.relationship` names an attribute on the target class which already has a method or attribute assigned to that name, as the backref declaration will replace that attribute. .. change:: :tags: bug, postgresql :tickets: 9020 Fixed regression where newly revised PostgreSQL range types such as :class:`_postgresql.INT4RANGE` could not be set up as the impl of a :class:`.TypeDecorator` custom type, instead raising a ``TypeError``. .. change:: :tags: usecase, orm :tickets: 7837 Adjustments to the :class:`_orm.Session` in terms of extensibility, as well as updates to the :class:`.ShardedSession` extension: * :meth:`_orm.Session.get` now accepts :paramref:`_orm.Session.get.bind_arguments`, which in particular may be useful when using the horizontal sharding extension. * :meth:`_orm.Session.get_bind` accepts arbitrary kw arguments, which assists in developing code that uses a :class:`_orm.Session` class which overrides this method with additional arguments. * Added a new ORM execution option ``identity_token`` which may be used to directly affect the "identity token" that will be associated with newly loaded ORM objects. This token is how sharding approaches (namely the :class:`.ShardedSession`, but can be used in other cases as well) separate object identities across different "shards". .. seealso:: :ref:`queryguide_identity_token` * The :meth:`_orm.SessionEvents.do_orm_execute` event hook may now be used to affect all ORM-related options, including ``autoflush``, ``populate_existing``, and ``yield_per``; these options are re-consumed subsequent to event hooks being invoked before they are acted upon. Previously, options like ``autoflush`` would have been already evaluated at this point. The new ``identity_token`` option is also supported in this mode and is now used by the horizontal sharding extension. * The :class:`.ShardedSession` class replaces the :paramref:`.ShardedSession.id_chooser` hook with a new hook :paramref:`.ShardedSession.identity_chooser`, which no longer relies upon the legacy :class:`_orm.Query` object. :paramref:`.ShardedSession.id_chooser` is still accepted in place of :paramref:`.ShardedSession.identity_chooser` with a deprecation warning. .. change:: :tags: usecase, orm :tickets: 9015 The behavior of "joining an external transaction into a Session" has been revised and improved, allowing explicit control over how the :class:`_orm.Session` will accommodate an incoming :class:`_engine.Connection` that already has a transaction and possibly a savepoint already established. The new parameter :paramref:`_orm.Session.join_transaction_mode` includes a series of option values which can accommodate the existing transaction in several ways, most importantly allowing a :class:`_orm.Session` to operate in a fully transactional style using savepoints exclusively, while leaving the externally initiated transaction non-committed and active under all circumstances, allowing test suites to rollback all changes that take place within tests. Additionally, revised the :meth:`_orm.Session.close` method to fully close out savepoints that may still be present, which also allows the "external transaction" recipe to proceed without warnings if the :class:`_orm.Session` did not explicitly end its own SAVEPOINT transactions. .. seealso:: :ref:`change_9015` .. change:: :tags: bug, sql :tickets: 8988 Added test support to ensure that all compiler ``visit_xyz()`` methods across all :class:`.Compiler` implementations in SQLAlchemy accept a ``**kw`` parameter, so that all compilers accept additional keyword arguments under all circumstances. .. change:: :tags: bug, postgresql :tickets: 8984 The :meth:`_postgresql.Range.__eq___` will now return ``NotImplemented`` when comparing with an instance of a different class, instead of raising an :exc:`AttributeError` exception. .. change:: :tags: bug, sql :tickets: 6114 The :meth:`.SQLCompiler.construct_params` method, as well as the :attr:`.SQLCompiler.params` accessor, will now return the exact parameters that correspond to a compiled statement that used the ``render_postcompile`` parameter to compile. Previously, the method returned a parameter structure that by itself didn't correspond to either the original parameters or the expanded ones. Passing a new dictionary of parameters to :meth:`.SQLCompiler.construct_params` for a :class:`.SQLCompiler` that was constructed with ``render_postcompile`` is now disallowed; instead, to make a new SQL string and parameter set for an alternate set of parameters, a new method :meth:`.SQLCompiler.construct_expanded_state` is added which will produce a new expanded form for the given parameter set, using the :class:`.ExpandedState` container which includes a new SQL statement and new parameter dictionary, as well as a positional parameter tuple. .. change:: :tags: bug, orm :tickets: 8703, 8997, 8996 A series of changes and improvements regarding :meth:`_orm.Session.refresh`. The overall change is that primary key attributes for an object are now included in a refresh operation unconditionally when relationship-bound attributes are to be refreshed, even if not expired and even if not specified in the refresh. * Improved :meth:`_orm.Session.refresh` so that if autoflush is enabled (as is the default for :class:`_orm.Session`), the autoflush takes place at an earlier part of the refresh process so that pending primary key changes are applied without errors being raised. Previously, this autoflush took place too late in the process and the SELECT statement would not use the correct key to locate the row and an :class:`.InvalidRequestError` would be raised. * When the above condition is present, that is, unflushed primary key changes are present on the object, but autoflush is not enabled, the refresh() method now explicitly disallows the operation to proceed, and an informative :class:`.InvalidRequestError` is raised asking that the pending primary key changes be flushed first. Previously, this use case was simply broken and :class:`.InvalidRequestError` would be raised anyway. This restriction is so that it's safe for the primary key attributes to be refreshed, as is necessary for the case of being able to refresh the object with relationship-bound secondary eagerloaders also being emitted. This rule applies in all cases to keep API behavior consistent regardless of whether or not the PK cols are actually needed in the refresh, as it is unusual to be refreshing some attributes on an object while keeping other attributes "pending" in any case. * The :meth:`_orm.Session.refresh` method has been enhanced such that attributes which are :func:`_orm.relationship`-bound and linked to an eager loader, either at mapping time or via last-used loader options, will be refreshed in all cases even when a list of attributes is passed that does not include any columns on the parent row. This builds upon the feature first implemented for non-column attributes as part of :ticket:`1763` fixed in 1.4 allowing eagerly-loaded relationship-bound attributes to participate in the :meth:`_orm.Session.refresh` operation. If the refresh operation does not indicate any columns on the parent row to be refreshed, the primary key columns will nonetheless be included in the refresh operation, which allows the load to proceed into the secondary relationship loaders indicated as it does normally. Previously an :class:`.InvalidRequestError` error would be raised for this condition (:ticket:`8703`) * Fixed issue where an unnecessary additional SELECT would be emitted in the case where :meth:`_orm.Session.refresh` were called with a combination of expired attributes, as well as an eager loader such as :func:`_orm.selectinload` that emits a "secondary" query, if the primary key attributes were also in an expired state. As the primary key attributes are now included in the refresh automatically, there is no additional load for these attributes when a relationship loader goes to select for them (:ticket:`8997`) * Fixed regression caused by :ticket:`8126` released in 2.0.0b1 where the :meth:`_orm.Session.refresh` method would fail with an ``AttributeError``, if passed both an expired column name as well as the name of a relationship-bound attribute that was linked to a "secondary" eagerloader such as the :func:`_orm.selectinload` eager loader (:ticket:`8996`) .. change:: :tags: bug, sql :tickets: 8994 To accommodate for third party dialects with different character escaping needs regarding bound parameters, the system by which SQLAlchemy "escapes" (i.e., replaces with another character in its place) special characters in bound parameter names has been made extensible for third party dialects, using the :attr:`.SQLCompiler.bindname_escape_chars` dictionary which can be overridden at the class declaration level on any :class:`.SQLCompiler` subclass. As part of this change, also added the dot ``"."`` as a default "escaped" character. .. change:: :tags: orm, feature :tickets: 8889 Added a new default value for the :paramref:`.Mapper.eager_defaults` parameter "auto", which will automatically fetch table default values during a unit of work flush, if the dialect supports RETURNING for the INSERT being run, as well as :ref:`insertmanyvalues <engine_insertmanyvalues>` available. Eager fetches for server-side UPDATE defaults, which are very uncommon, continue to only take place if :paramref:`.Mapper.eager_defaults` is set to ``True``, as there is no batch-RETURNING form for UPDATE statements. .. change:: :tags: usecase, orm :tickets: 8973 Removed the requirement that the ``__allow_unmapped__`` attribute be used on Declarative Dataclass Mapped class when non-``Mapped[]`` annotations are detected; previously, an error message that was intended to support legacy ORM typed mappings would be raised, which additionally did not mention correct patterns to use with Dataclasses specifically. This error message is now no longer raised if :meth:`_orm.registry.mapped_as_dataclass` or :class:`_orm.MappedAsDataclass` is used. .. seealso:: :ref:`orm_declarative_native_dataclasses_non_mapped_fields` .. change:: :tags: bug, orm :tickets: 8168 Improved a fix first made in version 1.4 for :ticket:`8456` which scaled back the usage of internal "polymorphic adapters", that are used to render ORM queries when the :paramref:`_orm.Mapper.with_polymorphic` parameter is used. These adapters, which are very complex and error prone, are now used only in those cases where an explicit user-supplied subquery is used for :paramref:`_orm.Mapper.with_polymorphic`, which includes only the use case of concrete inheritance mappings that use the :func:`_orm.polymorphic_union` helper, as well as the legacy use case of using an aliased subquery for joined inheritance mappings, which is not needed in modern use. For the most common case of joined inheritance mappings that use the built-in polymorphic loading scheme, which includes those which make use of the :paramref:`_orm.Mapper.polymorphic_load` parameter set to ``inline``, polymorphic adapters are now no longer used. This has both a positive performance impact on the construction of queries as well as a substantial simplification of the internal query rendering process. The specific issue targeted was to allow a :func:`_orm.column_property` to refer to joined-inheritance classes within a scalar subquery, which now works as intuitively as is feasible. .. changelog:: ``` ### 2.0.0b4 ``` :released: December 5, 2022 .. change:: :tags: usecase, orm :tickets: 8859 Added support custom user-defined types which extend the Python ``enum.Enum`` base class to be resolved automatically to SQLAlchemy :class:`.Enum` SQL types, when using the Annotated Declarative Table feature. The feature is made possible through new lookup features added to the ORM type map feature, and includes support for changing the arguments of the :class:`.Enum` that's generated by default as well as setting up specific ``enum.Enum`` types within the map with specific arguments. .. seealso:: :ref:`orm_declarative_mapped_column_enums` .. change:: :tags: bug, typing :tickets: 8783 Adjusted internal use of the Python ``enum.IntFlag`` class which changed its behavioral contract in Python 3.11. This was not causing runtime failures however caused typing runs to fail under Python 3.11. .. change:: :tags: usecase, typing :tickets: 8847 Added a new type :class:`.SQLColumnExpression` which may be indicated in user code to represent any SQL column oriented expression, including both those based on :class:`.ColumnElement` as well as on ORM :class:`.QueryableAttribute`. This type is a real class, not an alias, so can also be used as the foundation for other objects. An additional ORM-specific subclass :class:`.SQLORMExpression` is also included. .. change:: :tags: bug, typing :tickets: 8667, 6810 The ``sqlalchemy.ext.mutable`` extension and ``sqlalchemy.ext.automap`` extensions are now fully pep-484 typed. Huge thanks to Gleb Kisenkov for their efforts on this. .. change:: :tags: bug, sql :tickets: 8849 The approach to the ``numeric`` pep-249 paramstyle has been rewritten, and is now fully supported, including by features such as "expanding IN" and "insertmanyvalues". Parameter names may also be repeated in the source SQL construct which will be correctly represented within the numeric format using a single parameter. Introduced an additional numeric paramstyle called ``numeric_dollar``, which is specifically what's used by the asyncpg dialect; the paramstyle is equivalent to ``numeric`` except numeric indicators are indicated by a dollar-sign rather than a colon. The asyncpg dialect now uses ``numeric_dollar`` paramstyle directly, rather than compiling to ``format`` style first. The ``numeric`` and ``numeric_dollar`` paramstyles assume that the target backend is capable of receiving the numeric parameters in any order, and will match the given parameter values to the statement based on matching their position (1-based) to the numeric indicator. This is the normal behavior of "numeric" paramstyles, although it was observed that the SQLite DBAPI implements a not-used "numeric" style that does not honor parameter ordering. .. change:: :tags: usecase, postgresql :tickets: 8765 Complementing :ticket:`8690`, new comparison methods such as :meth:`_postgresql.Range.adjacent_to`, :meth:`_postgresql.Range.difference`, :meth:`_postgresql.Range.union`, etc., were added to the PG-specific range objects, bringing them in par with the standard operators implemented by the underlying :attr:`_postgresql.AbstractRange.comparator_factory`. In addition, the ``__bool__()`` method of the class has been corrected to be consistent with the common Python containers behavior as well as how other popular PostgreSQL drivers do: it now tells whether the range instance is *not* empty, rather than the other way around. Pull request courtesy Lele Gaifax. .. change:: :tags: bug, sql :tickets: 8770 Adjusted the rendering of ``RETURNING``, in particular when using :class:`_sql.Insert`, such that it now renders columns using the same logic as that of the :class:`.Select` construct to generate labels, which will include disambiguating labels, as well as that a SQL function surrounding a named column will be labeled using the column name itself. This establishes better cross-compatibility when selecting rows from either :class:`.Select` constructs or from DML statements that use :meth:`.UpdateBase.returning`. A narrower scale change was also made for the 1.4 series that adjusted the function label issue only. .. change:: :tags: change, postgresql, asyncpg :tickets: 8926 Changed the paramstyle used by asyncpg from ``format`` to ``numeric_dollar``. This has two main benefits since it does not require additional processing of the statement and allows for duplicate parameters to be present in the statements. .. change:: :tags: bug, orm :tickets: 8888 Fixed issue where use of an unknown datatype within a :class:`.Mapped` annotation for a column-based attribute would silently fail to map the attribute, rather than reporting an exception; an informative exception message is now raised. .. change:: :tags: bug, orm :tickets: 8777 Fixed a suite of issues involving :class:`.Mapped` use with dictionary types, such as ``Mapped[dict[str, str] | None]``, would not be correctly interpreted in Declarative ORM mappings. Support to correctly "de-optionalize" this type including for lookup in ``type_annotation_map`` has been fixed. .. change:: :tags: feature, orm :tickets: 8822 Added a new parameter :paramref:`_orm.mapped_column.use_existing_column` to accommodate the use case of a single-table inheritance mapping that uses the pattern of more than one subclass indicating the same column to take place on the superclass. This pattern was previously possible by using :func:`_orm.declared_attr` in conjunction with locating the existing column in the ``.__table__`` of the superclass, however is now updated to work with :func:`_orm.mapped_column` as well as with pep-484 typing, in a simple and succinct way. .. seealso:: :ref:`orm_inheritance_column_conflicts` .. change:: :tags: bug, mssql :tickets: 8917 Fixed regression caused by the combination of :ticket:`8177`, re-enable setinputsizes for SQL server unless fast_executemany + DBAPI executemany is used for a statement, along with :ticket:`6047`, implement "insertmanyvalues", which bypasses DBAPI executemany in place of a custom DBAPI execute for INSERT statements. setinputsizes would incorrectly not be used for a multiple parameter-set INSERT statement that used "insertmanyvalues" if fast_executemany were turned on, as the check would incorrectly assume this is a DBAPI executemany call. The "regression" would then be that the "insertmanyvalues" statement format is apparently slightly more sensitive to multiple rows that don't use the same types for each row, so in such a case setinputsizes is especially needed. The fix repairs the fast_executemany check so that it only disables setinputsizes if true DBAPI executemany is to be used. .. change:: :tags: bug, orm, performance :tickets: 8796 Additional performance enhancements within ORM-enabled SQL statements, specifically targeting callcounts within the construction of ORM statements, using combinations of :func:`_orm.aliased` with :func:`_sql.union` and similar "compound" constructs, in addition to direct performance improvements to the ``corresponding_column()`` internal method that is used heavily by the ORM by constructs like :func:`_orm.aliased` and similar. .. change:: :tags: bug, postgresql :tickets: 8884 Added additional type-detection for the new PostgreSQL :class:`_postgresql.Range` type, where previous cases that allowed the psycopg2-native range objects to be received directly by the DBAPI without SQLAlchemy intercepting them stopped working, as we now have our own value object. The :class:`_postgresql.Range` object has been enhanced such that SQLAlchemy Core detects it in otherwise ambiguous situations (such as comparison to dates) and applies appropriate bind handlers. Pull request courtesy Lele Gaifax. .. change:: :tags: bug, orm :tickets: 8880 Fixed bug in :ref:`orm_declarative_native_dataclasses` feature where using plain dataclass fields with the ``__allow_unmapped__`` directive in a mapping would not create a dataclass with the correct class-level state for those fields, copying the raw ``Field`` object to the class inappropriately after dataclasses itself had replaced the ``Field`` object with the class-level default value. .. change:: :tags: usecase, orm extensions :tickets: 8878 Added support for the :func:`.association_proxy` extension function to take part within Python ``dataclasses`` configuration, when using the native dataclasses feature described at :ref:`orm_declarative_native_dataclasses`. Included are attribute-level arguments including :paramref:`.association_proxy.init` and :paramref:`.association_proxy.default_factory`. Documentation for association proxy has also been updated to use "Annotated Declarative Table" forms within examples, including type annotations used for :class:`.AssocationProxy` itself. .. change:: :tags: bug, typing Corrected typing support for the :paramref:`_orm.relationship.secondary` argument which may also accept a callable (lambda) that returns a :class:`.FromClause`. .. change:: :tags: bug, orm, regression :tickets: 8812 Fixed regression where flushing a mapped class that's mapped against a subquery, such as a direct mapping or some forms of concrete table inheritance, would fail if the :paramref:`_orm.Mapper.eager_defaults` parameter were used. .. change:: :tags: bug, schema :tickets: 8925 Stricter rules are in place for appending of :class:`.Column` objects to :class:`.Table` objects, both moving some previous deprecation warnings to exceptions, and preventing some previous scenarios that would cause duplicate columns to appear in tables, when :paramref:`.Table.extend_existing` were set to ``True``, for both programmatic :class:`.Table` construction as well as during reflection operations. See :ref:`change_8925` for a rundown of these changes. .. seealso:: :ref:`change_8925` .. change:: :tags: usecase, orm :tickets: 8905 Added :paramref:`_orm.mapped_column.compare` parameter to relevant ORM attribute constructs including :func:`_orm.mapped_column`, :func:`_orm.relationship` etc. to provide for the Python dataclasses ``compare`` parameter on ``field()``, when using the :ref:`orm_declarative_native_dataclasses` feature. Pull request courtesy Simon Schiele. .. change:: :tags: sql, usecase :tickets: 6289 Added :class:`_expression.ScalarValues` that can be used as a column element allowing using :class:`_expression.Values` inside ``IN`` clauses or in conjunction with ``ANY`` or ``ALL`` collection aggregates. This new class is generated using the method :meth:`_expression.Values.scalar_values`. The :class:`_expression.Values` instance is now coerced to a :class:`_expression.ScalarValues` when used in a ``IN`` or ``NOT IN`` operation. .. change:: :tags: bug, orm :tickets: 8853 Fixed regression in 2.0.0b3 caused by :ticket:`8759` where indicating the :class:`.Mapped` name using a qualified name such as ``sqlalchemy.orm.Mapped`` would fail to be recognized by Declarative as indicating the :class:`.Mapped` construct. .. change:: :tags: bug, typing :tickets: 8842 Improved the typing for :class:`.sessionmaker` and :class:`.async_sessionmaker`, so that the default type of their return value will be :class:`.Session` or :class:`.AsyncSession`, without the need to type this explicitly. Previously, Mypy would not automaticaly infer these return types from its generic base. As part of this change, arguments for :class:`.Session`, :class:`.AsyncSession`, :class:`.sessionmaker` and :class:`.async_sessionmaker` beyond the initial "bind" argument have been made keyword-only, which includes parameters that have always been documented as keyword arguments, such as :paramref:`.Session.autoflush`, :paramref:`.Session.class_`, etc. Pull request courtesy Sam Bull. .. change:: :tags: bug, typing :tickets: 8776 Fixed issue where passing a callbale function returning an iterable of column elements to :paramref:`_orm.relationship.order_by` was flagged as an error in type checkers. .. changelog:: ``` ### 2.0.0b3 ``` :released: November 4, 2022 .. change:: :tags: bug, orm, declarative :tickets: 8759 Added support in ORM declarative annotations for class names specified for :func:`_orm.relationship`, as well as the name of the :class:`_orm.Mapped` symbol itself, to be different names than their direct class name, to support scenarios such as where :class:`_orm.Mapped` is imported as ``from sqlalchemy.orm import Mapped as M``, or where related class names are imported with an alternate name in a similar fashion. Additionally, a target class name given as the lead argument for :func:`_orm.relationship` will always supersede the name given in the left hand annotation, so that otherwise un-importable names th