]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
16 months agoassign variant mapping on adapt()
Mike Bayer [Wed, 20 Mar 2024 14:23:41 +0000 (10:23 -0400)] 
assign variant mapping on adapt()

Fixed regression from the 1.4 series where the refactor of the
:meth:`_types.TypeEngine.with_variant` method introduced at
:ref:`change_6980` failed to accommodate for the ``.copy()`` method, which
will lose the variant mappings that are set up. This becomes an issue for
the very specific case of a "schema" type, which includes types such as
:class:`.Enum` and :class:`.ARRAY`, when they are then used in the context
of an ORM Declarative mapping with mixins where copying of types comes into
play.  The variant mapping is now copied as well.

Fixes: #11176
Change-Id: Icf1a2752f60fce863c87ead8b0fe298b0f3d3766
(cherry picked from commit 29a428955a904e235e1b85e928cbe89155aeca82)

16 months agowork around boldface concerns
Mike Bayer [Tue, 19 Mar 2024 14:51:01 +0000 (10:51 -0400)] 
work around boldface concerns

Change-Id: I99ed117bb0f1bdc1a8750bd13db5a69d5c398ae0
(cherry picked from commit 697dcc94e412e013aba298e17613ee097f423e04)

16 months agoMerge "do not convert uuid to string in postgresql and mssql" into rel_2_0
Michael Bayer [Tue, 19 Mar 2024 14:44:01 +0000 (14:44 +0000)] 
Merge "do not convert uuid to string in postgresql and mssql" into rel_2_0

16 months agoMerge "document improvement for load_only" into rel_2_0
Michael Bayer [Tue, 19 Mar 2024 14:42:35 +0000 (14:42 +0000)] 
Merge "document improvement for load_only" into rel_2_0

16 months agoadd notes clarifying the role of "$user" in pg search_path
Mike Bayer [Tue, 19 Mar 2024 12:35:00 +0000 (08:35 -0400)] 
add notes clarifying the role of "$user" in pg search_path

references: https://github.com/sqlalchemy/alembic/discussions/1447
Change-Id: I2ef55813699f84ac7fbca6de7522f0d3d78e6029
(cherry picked from commit 58a50c06836792da201bb610ee2f0463ac1bb073)

16 months agodo not convert uuid to string in postgresql and mssql
Federico Caselli [Mon, 18 Mar 2024 21:01:00 +0000 (22:01 +0100)] 
do not convert uuid to string in postgresql and mssql

Change-Id: Ic3c87d8c654926f7ef28ba9ec6dd21c50a1171cf
(cherry picked from commit 5032cf6bc14f76e47063696a58ea3cce44e0f13f)

16 months agofix typo from d8174392dce20004d9158a90949b4ff11b830247
Federico Caselli [Mon, 18 Mar 2024 20:52:41 +0000 (21:52 +0100)] 
fix typo from d8174392dce20004d9158a90949b4ff11b830247

Change-Id: If76715abf6de8fc85580080a73aa5faa138aa968
(cherry picked from commit 82ae47ba9959c63cfaa9169869ef08db61f71fd7)

16 months agodocument improvement for load_only
Federico Caselli [Mon, 18 Mar 2024 20:50:35 +0000 (21:50 +0100)] 
document improvement for load_only

mention that load_only can be used to control what
populate existing refreses.

Change-Id: I9bd6fbe8674005d9f32f9d1bc263bf860b53c3ec
(cherry picked from commit 93da4ba1446162f1476598b4f13c307ae7bfb1f1)

16 months agoAdd impyla to external dialect list
Gord Thompson [Mon, 18 Mar 2024 13:26:17 +0000 (07:26 -0600)] 
Add impyla to external dialect list

Change-Id: I5a85db43a11c2c993597d0fa737377ee460b7629
(cherry picked from commit d8174392dce20004d9158a90949b4ff11b830247)

16 months agoMerge "remove sentinel_value_resolvers and use pre-bind values" into rel_2_0
Michael Bayer [Mon, 18 Mar 2024 18:17:18 +0000 (18:17 +0000)] 
Merge "remove sentinel_value_resolvers and use pre-bind values" into rel_2_0

16 months agoadd missing cache_ok directive to MyEpochType
Mike Bayer [Mon, 18 Mar 2024 14:22:06 +0000 (10:22 -0400)] 
add missing cache_ok directive to MyEpochType

Change-Id: Ic4da52b02a4ba36d87d73974fe428b91d9d7915c
(cherry picked from commit 4ef36de359449abd49b90726a1d06aef9a4084e7)

16 months agoremove sentinel_value_resolvers and use pre-bind values
Mike Bayer [Fri, 15 Mar 2024 14:51:02 +0000 (10:51 -0400)] 
remove sentinel_value_resolvers and use pre-bind values

Made a change to the adjustment made in version 2.0.10 for :ticket:`9618`,
which added the behavior of reconciling RETURNING rows from a bulk INSERT
to the parameters that were passed to it.  This behavior included a
comparison of already-DB-converted bound parameter values against returned
row values that was not always "symmetrical" for SQL column types such as
UUIDs, depending on specifics of how different DBAPIs receive such values
versus how they return them, necessitating the need for additional
"sentinel value resolver" methods on these column types.  Unfortunately
this broke third party column types such as UUID/GUID types in libraries
like SQLModel which did not implement this special method, raising an error
"Can't match sentinel values in result set to parameter sets".  Rather than
attempt to further explain and document this implementation detail of the
"insertmanyvalues" feature including a public version of the new
method, the approach is intead revised to no longer need this extra
conversion step, and the logic that does the comparison now works on the
pre-converted bound parameter value compared to the post-result-processed
value, which should always be of a matching datatype.  In the unusual case
that a custom SQL column type that also happens to be used in a "sentinel"
column for bulk INSERT is not receiving and returning the same value type,
the "Can't match" error will be raised, however the mitigation is
straightforward in that the same Python datatype should be passed as that
returned.

Fixes: #11160
Change-Id: Ica62571e923ad9545eb90502e6732b11875b164a
(cherry picked from commit 4c0af9e93dab62a04aa00f7c9a07c984e0e316df)

16 months agoMerge "mysql: Add new reserved words from MySQL 8.3." into rel_2_0
Federico Caselli [Fri, 15 Mar 2024 21:02:10 +0000 (21:02 +0000)] 
Merge "mysql: Add new reserved words from MySQL 8.3." into rel_2_0

16 months agofix mypy on python<3.10
Federico Caselli [Fri, 15 Mar 2024 19:42:16 +0000 (20:42 +0100)] 
fix mypy on python<3.10

Change-Id: Ice16ff3685f89c64607ef37a906e17c53a5324fd
(cherry picked from commit 34a974e509190497cd41831342dda0bdadf88891)

16 months agomysql: Add new reserved words from MySQL 8.3.
Sean Bright [Fri, 15 Mar 2024 17:57:28 +0000 (13:57 -0400)] 
mysql: Add new reserved words from MySQL 8.3.

Adds the following new keywords from MySQL 8.3:

* `intersect`
* `parallel`
* `qualify`

Sourced from https://dev.mysql.com/doc/refman/8.3/en/keywords.html

Fixes: #11166
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11167
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11167
Pull-request-sha: adc789cdc6ea66d73925e2a819ea70e60ec282e4

Change-Id: I4441389a4ebec02cdb8372051b6fab1280bcf198
(cherry picked from commit 03cedd7e2ff994636b915039b700858ae835c786)

16 months agoaccommodate schema_translate_map in _deliver_insertmanyvalues_batches
Mike Bayer [Wed, 13 Mar 2024 22:23:07 +0000 (18:23 -0400)] 
accommodate schema_translate_map in _deliver_insertmanyvalues_batches

Fixed issue in :ref:`engine_insertmanyvalues` feature where using a primary
key column with an "inline execute" default generator such as an explicit
:class:`.Sequence` with an explcit schema name, while at the same time
using the
:paramref:`_engine.Connection.execution_options.schema_translate_map`
feature would fail to render the sequence or the parameters properly,
leading to errors.

Fixes: #11157
Change-Id: I35666af46d40996aff35d3d39f48c150d838e6e4
(cherry picked from commit e3f7bc683ac3ea6d7c517b9c7ffeaa911860d732)

16 months agoMerge "Make instrumented attribute covariant as well" into rel_2_0
Michael Bayer [Wed, 13 Mar 2024 16:02:37 +0000 (16:02 +0000)] 
Merge "Make instrumented attribute covariant as well" into rel_2_0

16 months agoMerge "add doctests to asyncio tutorial" into rel_2_0
Michael Bayer [Wed, 13 Mar 2024 16:01:12 +0000 (16:01 +0000)] 
Merge "add doctests to asyncio tutorial" into rel_2_0

16 months agoMake instrumented attribute covariant as well
Ethan Langevin [Mon, 11 Mar 2024 11:41:58 +0000 (07:41 -0400)] 
Make instrumented attribute covariant as well

<!-- Provide a general summary of your proposed changes in the Title field above -->

Allows mapped relationships to use covariant types which makes it possible to define methods that operate on relationships in a typesafe way

### Description

See: https://github.com/sqlalchemy/sqlalchemy/issues/11112 for a more in depth explanation.

Just changed the type parameter in `InstrumentedAttribute` from `_T` to `_T_co`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11113
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11113
Pull-request-sha: 3c100f28661f3440769175a17c2763ed25f4b83a

Change-Id: Iff715c24f1556d5604dcd33661a0ee7232b9404b
(cherry picked from commit 058e10f2b7e5686198dc744107b32952e55dc93c)

16 months agoimprove docs for sqlite memory db
Federico Caselli [Tue, 12 Mar 2024 22:05:50 +0000 (23:05 +0100)] 
improve docs for sqlite memory db

Change-Id: Icdbc13bdad3fb5ae69e79605bb7e6cb82d538c80
References: #10968
(cherry picked from commit e560794883c5a3259aa4208ee7c5aa0740cb3087)

16 months agoupdate section be qualified for PGBouncer
Mike Bayer [Mon, 11 Mar 2024 23:59:06 +0000 (19:59 -0400)] 
update section be qualified for PGBouncer

the NullPool advice is for PGBouncer only

Change-Id: Ib79cae8965435b78fbde6e2d4de5e35fcd2a2f21
(cherry picked from commit f99209583272b65a71c0b4884fd14edcf6577939)

16 months agoadd doctests to asyncio tutorial
Federico Caselli [Mon, 26 Feb 2024 21:16:18 +0000 (22:16 +0100)] 
add doctests to asyncio tutorial

Change-Id: I28c94a7bc1e7ae572af0d206b8e63a110dc6fd7a
(cherry picked from commit e32954b91eef968be33ac4b46c16055daffa90dd)

16 months agoMerge "Update docs references to .execute() with string literal" into main
Federico Caselli [Mon, 11 Mar 2024 22:35:49 +0000 (22:35 +0000)] 
Merge "Update docs references to .execute() with string literal" into main

(cherry picked from commit ca759fdc6c105922141898b29dfaafbd8b76b873)

16 months agoMention getitem on automap classes property
Federico Caselli [Mon, 11 Mar 2024 22:11:28 +0000 (23:11 +0100)] 
Mention getitem on automap classes property

Fixes #11097

Change-Id: I05198c8288e11fb0c645e9a7d46652fa979b56f7
(cherry picked from commit f0822f0d930c33ec66e440db99e90641f612338c)

16 months agoMerge "Fixes: #10933 typing in ColumnExpressionArgument" into main
Federico Caselli [Mon, 11 Mar 2024 22:10:55 +0000 (22:10 +0000)] 
Merge "Fixes: #10933 typing in ColumnExpressionArgument" into main

(cherry picked from commit 716189460f69a9f44dce3af1d47eab4560def86b)

16 months agoMerge "Allow using AsyncEngine in compile" into rel_2_0
Michael Bayer [Mon, 11 Mar 2024 22:04:52 +0000 (22:04 +0000)] 
Merge "Allow using AsyncEngine in compile" into rel_2_0

16 months agoFixing typos (#11105)
Andreas Deininger [Mon, 11 Mar 2024 21:40:14 +0000 (22:40 +0100)] 
Fixing typos (#11105)

(cherry picked from commit 1f6a129d80453e274d1e14631f065b1afaa37b96)

Change-Id: I5d6197cae2470e3df8d09b3ca8ea186a91e4811a

16 months agoFixes: #11083 (#11095)
Daniel Robert [Mon, 11 Mar 2024 21:34:20 +0000 (14:34 -0700)] 
Fixes: #11083 (#11095)
(cherry picked from commit 3551c7b66ab0318deef419fbe61fe038b6e2825c)

Change-Id: I959dff7f4ee6218267627e878283e3c48b88b314

16 months agoadd a docs cross-reference between adding columns & relationships to existing table...
Jens Troeger [Mon, 11 Mar 2024 21:11:45 +0000 (17:11 -0400)] 
add a docs cross-reference between adding columns & relationships to existing table mappings

For context see discussion https://github.com/sqlalchemy/sqlalchemy/discussions/11124. This change adds the requested cross-reference to the documentation.

This pull request is:

- [X] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11133
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11133
Pull-request-sha: f8cc7a9c510f058f75bcb4308f3f398b8ae70de8

Change-Id: Ic683354fa05560d869d47ceda820d88e758e2973
(cherry picked from commit ba9c86f2075bd4eb1d71caca58b6da6fe19e35ac)

16 months agochore: remove repetitive words (#11134)
acceptacross [Mon, 11 Mar 2024 21:01:42 +0000 (05:01 +0800)] 
chore: remove repetitive words (#11134)

Signed-off-by: acceptacross <csqcqs@gmail.com>
(cherry picked from commit 64b661d7058818ad6852b208a877804eba294d91)

16 months agofix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)
Denis Laxalde [Mon, 11 Mar 2024 20:59:51 +0000 (21:59 +0100)] 
fix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)

Some were unused, some were missing.

(cherry picked from commit 461ababb789dd024f4e9d0c5f06e405eb911026e)

16 months agofix usage of kwargs to execute in docs
Federico Caselli [Mon, 11 Mar 2024 20:58:46 +0000 (21:58 +0100)] 
fix usage of kwargs to execute in docs

Change-Id: I033cba49ba6c12113643b88e48c5917f2b70a307
(cherry picked from commit af4df5e2a2405cfef3aa26bbb8f48e24d954a370)

16 months agoAllow using AsyncEngine in compile
Eugene Toder [Mon, 11 Mar 2024 11:42:47 +0000 (07:42 -0400)] 
Allow using AsyncEngine in compile

This works, so only need to update the type annotation.

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed

Closes: #11103
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11103
Pull-request-sha: ba9e61a3902d5666a5176aedd50afe8ae7762bff

Change-Id: I3d08b930a8cae0539bf9b436d5e806d8912cdee0
(cherry picked from commit d2a743d0bcd88129f571f2256cd18f1b02036fd2)

16 months agoFixed typing issues with sync code runners
Francisco R. Del Roio [Sun, 25 Feb 2024 19:37:27 +0000 (14:37 -0500)] 
Fixed typing issues with sync code runners

Fixed typing issue allowing asyncio ``run_sync()`` methods to correctly
type the parameters according to the callable that was passed, making use
of :pep:`612` ``ParamSpec`` variables.  Pull request courtesy Francisco R.
Del Roio.

Closes: #11055
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11055
Pull-request-sha: 712b4382b16e4c07c09ac40a570c4bfb76c28161

Change-Id: I94ec8bbb0688d6c6e1610f8f769abab550179c14
(cherry picked from commit b687624f63b8613f3c487866292fa88f763c79ee)

16 months agoadd extra pep695 conversion step
Mike Bayer [Sat, 9 Mar 2024 17:47:01 +0000 (12:47 -0500)] 
add extra pep695 conversion step

Added support for the :pep:`695` ``TypeAliasType`` construct as well as the
python 3.12 native ``type`` keyword to work with ORM Annotated Declarative
form when using these constructs to link to a :pep:`593` ``Annotated``
container, allowing the resolution of the ``Annotated`` to proceed when
these constructs are used in a :class:`_orm.Mapped` typing container.

Fixes: #11130
Change-Id: I9a386943966de2107f15f08dfe6ed2aa84f7e86c
(cherry picked from commit 985193c407ffb891c8eed042fac6f9547a34d694)

16 months agoMerge "use a fixed date that's not near DST switchover" into rel_2_0
Michael Bayer [Sat, 9 Mar 2024 20:56:20 +0000 (20:56 +0000)] 
Merge "use a fixed date that's not near DST switchover" into rel_2_0

16 months agodocument caveat for #11054
Mike Bayer [Sat, 9 Mar 2024 18:41:05 +0000 (13:41 -0500)] 
document caveat for #11054

Fixes: #11054
Change-Id: I1a5a9586d024d84dacf37742d710baf7b8f7570f
(cherry picked from commit 10fb1328ba53f0dc64355b45abd9e4e321589fae)

16 months agouse a fixed date that's not near DST switchover
Mike Bayer [Sat, 9 Mar 2024 15:05:03 +0000 (10:05 -0500)] 
use a fixed date that's not near DST switchover

CI has been failing here due to the DST switchover regarding
live dates.

Change-Id: I98b2dbe646180f41f948bec20193fdf3f63501b8
(cherry picked from commit 5b94dfad5ebc0ef9f929a7d9c7200ca577fea9b2)

17 months agoaccommodate False conditions for unique / index merge
Mike Bayer [Mon, 4 Mar 2024 14:12:34 +0000 (09:12 -0500)] 
accommodate False conditions for unique / index merge

Fixed issue in ORM annotated declarative where using
:func:`_orm.mapped_column()` with an :paramref:`_orm.mapped_column.index`
or :paramref:`_orm.mapped_column.unique` setting of False would be
overridden by an incoming ``Annotated`` element that featured that
parameter set to ``True``, even though the immediate
:func:`_orm.mapped_column()` element is more specific and should take
precedence.  The logic to reconcile the booleans has been enhanced to
accommodate a local value of ``False`` as still taking precedence over an
incoming ``True`` value from the annotated element.

Fixes: #11091
Change-Id: I15cda4a0a07a289015c0a09bbe3ca2849956604e
(cherry picked from commit e4c4bd03abae2d3948f894d38992d51c9be2a8c0)

17 months agoVersion 2.0.29 placeholder
Mike Bayer [Mon, 4 Mar 2024 13:41:51 +0000 (08:41 -0500)] 
Version 2.0.29 placeholder

17 months ago- 2.0.28 rel_2_0_28
Mike Bayer [Mon, 4 Mar 2024 13:32:33 +0000 (08:32 -0500)] 
- 2.0.28

17 months agocherry-pick changelog update for 1.4.53
Mike Bayer [Mon, 4 Mar 2024 13:30:05 +0000 (08:30 -0500)] 
cherry-pick changelog update for 1.4.53

(cherry picked from commit cb00a5252e240c2b0308a2891989836473633538)

17 months agocherry-pick changelog from 1.4.52
Mike Bayer [Mon, 4 Mar 2024 13:30:04 +0000 (08:30 -0500)] 
cherry-pick changelog from 1.4.52

(cherry picked from commit 662006d4f84f54b2bcddea5025696e8134a187f6)

17 months agoMerge "Add support for preserve_rowcount execution_option" into rel_2_0
Michael Bayer [Mon, 4 Mar 2024 06:09:04 +0000 (06:09 +0000)] 
Merge "Add support for preserve_rowcount execution_option" into rel_2_0

17 months agoMerge "adjust bound parameters within cache key only, dont deep copy" into rel_2_0
Michael Bayer [Mon, 4 Mar 2024 06:08:12 +0000 (06:08 +0000)] 
Merge "adjust bound parameters within cache key only, dont deep copy" into rel_2_0

17 months agosupport pytest 8.1
Mike Bayer [Mon, 4 Mar 2024 04:03:14 +0000 (23:03 -0500)] 
support pytest 8.1

This is a bump in the tox.ini file.   it's possible we
don't need to change anything else as we had help from the pytest
people a few years back to make sure our API use was fairly modern.

Alembic is having problems that appear to be separate.

Change-Id: If0348dc4915522d31d3ab970df31244bbc8b8ca4
(cherry picked from commit bc4d9ceec1c73c6a4e36d570052ff5e588462443)

17 months agoadjust bound parameters within cache key only, dont deep copy
Mike Bayer [Sat, 2 Mar 2024 05:28:26 +0000 (00:28 -0500)] 
adjust bound parameters within cache key only, dont deep copy

Adjusted the fix made in :ticket:`10570`, released in 2.0.23, where new
logic was added to reconcile possibly changing bound parameter values
across cache key generations used within the :func:`_orm.with_expression`
construct.  The new logic changes the approach by which the new bound
parameter values are associated with the statement, avoiding the need to
deep-copy the statement which can result in a significant performance
penalty for very deep / complex SQL constructs.  The new approach no longer
requires this deep-copy step.

Fixes: #11085
Change-Id: Ia51eb4e949c8f37af135399925a9916b9ed4ad2f
(cherry picked from commit 06be748b474246c1061c309f16f5648ae9bb3954)

17 months agoAdd support for preserve_rowcount execution_option
Federico Caselli [Wed, 7 Feb 2024 21:11:25 +0000 (22:11 +0100)] 
Add support for preserve_rowcount execution_option

Added new core execution option
paramref:`_engine.Connection.execution_options.preserve_rowcount`
to unconditionally save the ``rowcount`` attribute from the cursor in the
class:`_engine.Result` returned from an execution, regardless of the
statement being executed.
When this option is provided the correct value is also set when
an INSERT makes use of the "insertmanyvalues" mode, that may use
more than one actualy cursor execution.

Fixes: #10974
Change-Id: Icecef6b7539be9f0a1a02b9539864f5f163dcfbc
(cherry picked from commit f0537442eb7d3a3b2e702c8843c3c277fbfda0ac)

17 months agoadd 1.4 changelog for #10365
Mike Bayer [Thu, 29 Feb 2024 16:07:22 +0000 (11:07 -0500)] 
add 1.4 changelog for #10365

Change-Id: I3359274337f214132f35d9c4b722c97685b63d72
(cherry picked from commit 9bcc4da735891d09a4c850c5f29b3abeef13ce27)

17 months agofix typos in docs
Federico Caselli [Mon, 26 Feb 2024 21:16:38 +0000 (22:16 +0100)] 
fix typos in docs

Change-Id: Iaba3c5979af626055acb0068cc8aac0c7334b0e0
(cherry picked from commit 8a171bb3391e916d19ddf853dc2f9f5e5756c16e)

17 months agofix issue in asincio doc example
Federico Caselli [Mon, 26 Feb 2024 20:11:20 +0000 (21:11 +0100)] 
fix issue in asincio doc example

Change-Id: Idd55c07a57381450ab5c9db99854b6a1668f0382
(cherry picked from commit 191b67b948291a6d1b6e6c2a4a17b181d43ecb56)

17 months agoAdded YugabyteDB dialect to the documentation (#11047)
Sfurti-yb [Thu, 22 Feb 2024 19:37:24 +0000 (01:07 +0530)] 
Added YugabyteDB dialect to the documentation (#11047)

* Added YugabyteDB dialect to the documentation

* Update doc/build/dialects/index.rst

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
---------

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
(cherry picked from commit 5c88498ba8ba5f7c524d5aca130e5a59a8940766)

17 months agoReplace non-standard Python plat env marker (#11035)
layday [Wed, 21 Feb 2024 20:13:13 +0000 (22:13 +0200)] 
Replace non-standard Python plat env marker (#11035)

Fixes #11034.

(cherry picked from commit 78d0a24f98e3a7f3ea76acf5e47ace848adc2e2b)

Change-Id: I43e5229612e6a881e547db08780f3223dfe1c5c3

17 months agoDocumenting multiprocessing and events (#10831)
James Braza [Wed, 21 Feb 2024 19:52:14 +0000 (14:52 -0500)] 
Documenting multiprocessing and events (#10831)

* Added documentation on multiprocessing support for event system

* Incorporating zzzeek's PR comments into docs as tip section

* Removed tip and changed section title to 'Events and Multiprocessing'

* Adopting zzzeek's PR comment suggestions

* Tweaked wording to be more concise

(cherry picked from commit e1e95a6a34ce201840a22c73b7f7dce358fe71d1)

17 months agoMerge "raise for asyncio-incompatible pool classes" into rel_2_0
Michael Bayer [Tue, 20 Feb 2024 15:09:00 +0000 (15:09 +0000)] 
Merge "raise for asyncio-incompatible pool classes" into rel_2_0

17 months agoFix mysql dialect text docstring, length is interpreted as byte size
Zhong Zheng [Fri, 16 Feb 2024 17:20:59 +0000 (12:20 -0500)] 
Fix mysql dialect text docstring, length is interpreted as byte size

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
The `Text` and its variant types in MySQL are bytes size limited, not character length, so fixing the doctoring where the upper limit uses the `characters` as the unit instead of `bytes`

https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html

<img width="878" alt="Screenshot 2024-02-15 at 17 27 59" src="https://github.com/sqlalchemy/sqlalchemy/assets/5219229/29731769-f57e-46f9-858b-46feda0ae83c">

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11018
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11018
Pull-request-sha: 13fa52917efea9a229c7abf19a3be40e24a79cb9

Change-Id: Iea903a6dc4b52ee4b7b5d2d64256c69abbd1f8aa
(cherry picked from commit 1c58fe53b6fd069cbb82955ddaf9eb5405076146)

17 months agoUpdate Actian entry in External Dialects table (#11014)
Michael Habiger [Fri, 16 Feb 2024 17:16:44 +0000 (11:16 -0600)] 
Update Actian entry in External Dialects table (#11014)

(cherry picked from commit edc00d9e96661328621aea3f3849b493a365bbbe)

17 months agoraise for asyncio-incompatible pool classes
Mike Bayer [Thu, 15 Feb 2024 02:10:20 +0000 (21:10 -0500)] 
raise for asyncio-incompatible pool classes

An error is raised if a :class:`.QueuePool` or other non-asyncio pool class
is passed to :func:`_asyncio.create_async_engine`.  This engine only
accepts asyncio-compatible pool classes including
:class:`.AsyncAdaptedQueuePool`. Other pool classes such as
:class:`.NullPool` are compatible with both synchronous and asynchronous
engines as they do not perform any locking.

Fixes: #8771
Change-Id: I5843ccea7d824488492d1a9d46207b9f05330ae3
(cherry picked from commit c449505f651ebf4b73aaa7d7aec99b038ea34cb6)

17 months agoMerge "ensure secondary cols not excluded from adaption" into rel_2_0
Michael Bayer [Thu, 15 Feb 2024 01:04:28 +0000 (01:04 +0000)] 
Merge "ensure secondary cols not excluded from adaption" into rel_2_0

17 months agoclarify example in orm tutorial
Federico Caselli [Wed, 14 Feb 2024 19:55:57 +0000 (20:55 +0100)] 
clarify example in orm tutorial

Change-Id: Ib6f9a7ce0beacda43ccd6d3c7750778ed3333b38
(cherry picked from commit 1e099d1a855e492389c02559d2059d93e5a5a091)

17 months agoensure secondary cols not excluded from adaption
Mike Bayer [Wed, 14 Feb 2024 14:29:19 +0000 (09:29 -0500)] 
ensure secondary cols not excluded from adaption

Fixed regression caused by :ticket:`9779` where using the "secondary" table
in a relationship ``and_()`` expression would fail to be aliased to match
how the "secondary" table normally renders within a
:meth:`_sql.Select.join` expression, leading to an invalid query.

Fixes: #11010
Change-Id: I535ce8b14f6a779c26b6b50b796ce64e57d7ee3d
(cherry picked from commit 8844cb0b4148ff52c0377edf01d6e88f3bbe1ab0)

17 months agoVersion 2.0.28 placeholder
Mike Bayer [Tue, 13 Feb 2024 15:05:54 +0000 (10:05 -0500)] 
Version 2.0.28 placeholder

17 months ago- 2.0.27 rel_2_0_27
Mike Bayer [Tue, 13 Feb 2024 15:02:14 +0000 (10:02 -0500)] 
- 2.0.27

17 months agouse correct exception for terminate catch + test
Mike Bayer [Tue, 13 Feb 2024 13:45:53 +0000 (08:45 -0500)] 
use correct exception for terminate catch + test

Fixed regression caused by just-released fix for :ticket:`10863` where an
invalid exception class were added to the "except" block, which does not
get exercised unless such a catch actually happens.   A mock-style test has
been added to ensure this catch is exercised in unit tests.

Fixes: #11005
Change-Id: I5a65403fb7bb35296ff44ae3cf6a336f8e0bda97
(cherry picked from commit 80b52dc522f9f03a86ca6c3a5766cd9c594804ec)

17 months agoVersion 2.0.27 placeholder
Mike Bayer [Sun, 11 Feb 2024 15:15:17 +0000 (10:15 -0500)] 
Version 2.0.27 placeholder

17 months ago- 2.0.26 rel_2_0_26
Mike Bayer [Sun, 11 Feb 2024 15:11:07 +0000 (10:11 -0500)] 
- 2.0.26

17 months agofix changelog messages
Mike Bayer [Sun, 11 Feb 2024 15:08:22 +0000 (10:08 -0500)] 
fix changelog messages

Change-Id: I5af8f59ec15820f83210f49aab3006b726484301
(cherry picked from commit a15df7a107912e393352dc2bf378e7cf8f537b71)

17 months agohandle case where neither side has a cache key
Mike Bayer [Thu, 8 Feb 2024 13:45:22 +0000 (08:45 -0500)] 
handle case where neither side has a cache key

Fixed issue where an assertion within the implementation for
:func:`_orm.with_expression` would raise if a SQL expression that was not
cacheable were used; this was a 2.0 regression since 1.4.

Fixes: #10990
Change-Id: I6541189d29d2e860df7fbab187bfcc6f4dcbfc76
(cherry picked from commit d97679e0926b829592bf5962d9dae5f2fe99503f)

17 months agoMerge "Fix typing generics in PostgreSQL range types." into rel_2_0
Federico Caselli [Wed, 7 Feb 2024 19:49:08 +0000 (19:49 +0000)] 
Merge "Fix typing generics in PostgreSQL range types." into rel_2_0

17 months agoFixed typo on ordered_values example. (#10984)
Siloé Garcez [Wed, 7 Feb 2024 18:14:24 +0000 (15:14 -0300)] 
Fixed typo on ordered_values example. (#10984)

(cherry picked from commit 009aa8cb63dd082e1ba0c4a96a39980d36e26e71)

17 months agoFix typing generics in PostgreSQL range types.
Jim Bosch [Tue, 14 Nov 2023 21:19:31 +0000 (16:19 -0500)] 
Fix typing generics in PostgreSQL range types.

Correctly type PostgreSQL RANGE and MULTIRANGE types as ``Range[T]``
and ``Sequence[Range[T]]``.
Introduced utility sequence ``MultiRange`` to allow better
interoperability of MULTIRANGE types.

Fixes #9736
Closes: #10625
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10625
Pull-request-sha: 2c17bc5f922a2bdb805a29e458184076ccc08055

Change-Id: I4f91d0233b29fd8101e67bdd4cd0aa2524ab788a
(cherry picked from commit 4006cb38e13ac471655f5f27102678ed8933ee60)

17 months agoMerge "include cls locals in annotation evaluate" into rel_2_0
Michael Bayer [Wed, 7 Feb 2024 00:46:12 +0000 (00:46 +0000)] 
Merge "include cls locals in annotation evaluate" into rel_2_0

17 months agoMerge "remove unnecessary string concat in same line" into rel_2_0
Michael Bayer [Wed, 7 Feb 2024 00:44:42 +0000 (00:44 +0000)] 
Merge "remove unnecessary string concat in same line" into rel_2_0

17 months agoMerge "remove unneeded constructors for Unicode, UnicodeText" into rel_2_0
Michael Bayer [Wed, 7 Feb 2024 00:42:48 +0000 (00:42 +0000)] 
Merge "remove unneeded constructors for Unicode, UnicodeText" into rel_2_0

17 months agorestore uuid_data_type as closed at top level
Mike Bayer [Tue, 6 Feb 2024 23:11:32 +0000 (18:11 -0500)] 
restore uuid_data_type as closed at top level

the supports_native_uuid attribute does NOT indicate
the UUID datatype being present, only that Uuid(native_uuid=True)
would be able to produce something. On SQL Server it produces
UNIQUEIDENTIFIER.  The current use for this requirement is
that of testing the uppercase UUID type that has to match
that exactly.

Change-Id: I050e5d1889f804ee3763b84828f2bd6a47dd265e
(cherry picked from commit f932fc762d40f9b3bb305eb8db8b890483282502)

17 months agoremove unneeded constructors for Unicode, UnicodeText
Mike Bayer [Tue, 6 Feb 2024 19:11:05 +0000 (14:11 -0500)] 
remove unneeded constructors for Unicode, UnicodeText

References: https://github.com/sqlalchemy/sqlalchemy/pull/10970
Change-Id: I59461bcd6359314c0c0a99923da5e3f3d3ddbfff
(cherry picked from commit 2202fa4c1318c5342625159e035793cb11fa50bb)

17 months agoremove unnecessary string concat in same line
Federico Caselli [Tue, 6 Feb 2024 18:44:47 +0000 (19:44 +0100)] 
remove unnecessary string concat in same line

manually update the files to remove literal string concat on the same line,
since black does not seem to be making progress in handling these

Change-Id: I3c651374c5f3db5b8bc0c700328d67ca03743b7b
(cherry picked from commit 3fbbe8d67b8b193dcf715905392b1c8f33e68f35)

17 months agoFix mariadb run tests doc (#10848)
whysage [Tue, 6 Feb 2024 17:57:21 +0000 (19:57 +0200)] 
Fix mariadb run tests doc (#10848)

(cherry picked from commit ffdbd326bbea8d7d68e08285c50d0da351ebf95a)

17 months agoImprove formatting of data_select.rst (#10931)
Umer Zia [Tue, 6 Feb 2024 17:56:09 +0000 (18:56 +0100)] 
Improve formatting of data_select.rst (#10931)

(cherry picked from commit 3a4e9063e47e660c2d49ba6e62d7f647a1b6e76a)

17 months agoAdd bullets (#10973)
Artem Smirnov [Tue, 6 Feb 2024 17:55:41 +0000 (19:55 +0200)] 
Add bullets (#10973)

* Add bullets

* Fix as suggested

(cherry picked from commit 70ee72b2cb1dbfa37f29628737ab7dccf2de0fa3)

17 months agoBump pypa/cibuildwheel from 2.16.2 to 2.16.5 (#10947)
dependabot[bot] [Tue, 6 Feb 2024 17:53:28 +0000 (18:53 +0100)] 
Bump pypa/cibuildwheel from 2.16.2 to 2.16.5 (#10947)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16.2 to 2.16.5.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.16.2...v2.16.5)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit af1f9a4f3b246a396231004744ef5705b0f0a845)

17 months agoupdate .git-blame-ignore-revs to exclude black update commit
Federico Caselli [Tue, 6 Feb 2024 17:51:14 +0000 (18:51 +0100)] 
update .git-blame-ignore-revs to exclude black update commit

Change-Id: Ia713fe6e880c3eba50386bcc1b04ca518160d7d5

18 months agoinclude cls locals in annotation evaluate
Mike Bayer [Thu, 18 Jan 2024 17:47:02 +0000 (12:47 -0500)] 
include cls locals in annotation evaluate

Fixed issue where it was not possible to use a type (such as an enum)
within a :class:`_orm.Mapped` container type if that type were declared
locally within the class body.  The scope of locals used for the eval now
includes that of the class body itself.  In addition, the expression within
:class:`_orm.Mapped` may also refer to the class name itself, if used as a
string or with future annotations mode.

Fixes: #10899
Change-Id: Id4d07499558e457e63b483ff44c0972d9265409d
(cherry picked from commit e9a05cf88811c4c4ca51b8103539a7727630d2f0)

18 months agoMerge "add additional IMV UUID tests, fix pymssql case" into rel_2_0
Michael Bayer [Tue, 6 Feb 2024 00:27:53 +0000 (00:27 +0000)] 
Merge "add additional IMV UUID tests, fix pymssql case" into rel_2_0

18 months agoMerge "Update black to 24.1.1" into rel_2_0
Michael Bayer [Mon, 5 Feb 2024 23:18:50 +0000 (23:18 +0000)] 
Merge "Update black to 24.1.1" into rel_2_0

18 months agoadd additional IMV UUID tests, fix pymssql case
Mike Bayer [Mon, 5 Feb 2024 17:02:19 +0000 (12:02 -0500)] 
add additional IMV UUID tests, fix pymssql case

Fixed an issue regarding the use of the :class:`.Uuid` datatype with the
:paramref:`.Uuid.as_uuid` parameter set to False, when using the pymssql
dialect. ORM-optimized INSERT statements (e.g. the "insertmanyvalues"
feature) would not correctly align primary key UUID values for bulk INSERT
statements, resulting in errors.

This change also adds a small degree of generalization to the
Uuid datatype by adding the native/non-native compilation conditional
to the base compiler.

Patch is originally part of Ib920871102b9b64f2cba9697f5cb72b6263e4ed8
which is implementing native UUID for mariadb in 2.1 only.

Change-Id: I96cbec5c0ece312b345206aa5a5db2ffcf732d41
(cherry picked from commit 9b1c9d5d2e2f9a1e83cf80ca5cd834de213e59ea)

18 months agorun postfetch_post_update for version_id_col even if delete
Mike Bayer [Mon, 5 Feb 2024 21:06:28 +0000 (16:06 -0500)] 
run postfetch_post_update for version_id_col even if delete

Fixed issue where using :meth:`_orm.Session.delete` along with the
:paramref:`_orm.Mapper.version_id_col` feature would fail to use the
correct version identifier in the case that an additional UPDATE were
emitted against the target object as a result of the use of
:paramref:`_orm.relationship.post_update` on the object.  The issue is
similar to :ticket:`10800` just fixed in version 2.0.25 for the case of
updates alone.

Fixes: #10967
Change-Id: I959e9a2cc3e750e86e8de7b12b28ee1e819ed6d8
(cherry picked from commit 367e0e27a2e6930c66f2f98fbe477f9b1f06e2ca)

18 months agoUpdate black to 24.1.1
Federico Caselli [Wed, 31 Jan 2024 22:20:26 +0000 (23:20 +0100)] 
Update black to 24.1.1

Change-Id: Iadaea7b798d8e99302e1acb430dc7b758ca61137

18 months agoExport array module from postgresql
Federico Caselli [Mon, 29 Jan 2024 19:09:56 +0000 (20:09 +0100)] 
Export array module from postgresql

Before this module was shadowed by same named array classe.

Change-Id: I6fc56795c9363a9a07466fd36fcd49d0fb9658f7
(cherry picked from commit 47716f5a45eb91361a5fdabb420144a1807ca8ae)

18 months agoMerge "suffix index names with "_history" just like tables" into rel_2_0
Michael Bayer [Sat, 27 Jan 2024 22:55:18 +0000 (22:55 +0000)] 
Merge "suffix index names with "_history" just like tables" into rel_2_0

18 months agore-establish section on why __init__ not called on load
Mike Bayer [Fri, 26 Jan 2024 14:17:31 +0000 (09:17 -0500)] 
re-establish section on why __init__ not called on load

this section got lost, leaving the FAQ to point to an
empty document.  Rewrite a new section introducing that
__init__ is not called on load, illustrate strategies.

I am not that happy with *where* this doc is, as this is
supposed to be "mapping styles" high level introductory
type stuff, but there's nowhere else for it.

References: https://github.com/sqlalchemy/sqlalchemy/discussions/10923
Change-Id: Ie9260e4076bc82da0ef6dc11349a85beb0223a33
(cherry picked from commit f7b40c0102c33faf350917f5b98c61d4c6fbec90)

18 months agoFix typo in a docstring (#10925)
Eugene Toder [Thu, 25 Jan 2024 22:19:44 +0000 (17:19 -0500)] 
Fix typo in a docstring (#10925)

* Fix typo in a docstring

It's "compiled_cache" not "query_cache".

* Update async engine as well

(cherry picked from commit e7cda85d81038cf390a15b93d5276754a8cc2514)

18 months agoMerge "Support specifying access method when creating Postgres tables" into rel_2_0
Michael Bayer [Wed, 24 Jan 2024 15:32:48 +0000 (15:32 +0000)] 
Merge "Support specifying access method when creating Postgres tables" into rel_2_0

18 months agoMerge "Correct type hint for FunctionElement.table_valued()" into rel_2_0
Michael Bayer [Wed, 24 Jan 2024 15:32:03 +0000 (15:32 +0000)] 
Merge "Correct type hint for FunctionElement.table_valued()" into rel_2_0

18 months agosuffix index names with "_history" just like tables
Mike Bayer [Tue, 23 Jan 2024 19:06:01 +0000 (14:06 -0500)] 
suffix index names with "_history" just like tables

Fixed regression in history_meta example where the use of
:meth:`_schema.MetaData.to_metadata` to make a copy of the history table
would also copy indexes (which is a good thing), but causing naming
conflicts indexes regardless of naming scheme used for those indexes. A
"_history" suffix is now added to these indexes in the same way as is
achieved for the table name.

Fixes: #10920
Change-Id: I78823650956ff979d500bedbdbce261048894ce9
(cherry picked from commit dab1da6049d210843c16d96b20ae0efc063eead3)

18 months agofix a docs typo (#10912)
Jeff Balogh [Tue, 23 Jan 2024 19:25:10 +0000 (13:25 -0600)] 
fix a docs typo (#10912)

The code following this declaration suggests the employee.type should be `sysadmin`

(cherry picked from commit abadb149597e5891551b84e47d3085c3f1753ef2)

18 months agoUpdate cascades.rst (#10918)
Gord Thompson [Tue, 23 Jan 2024 19:22:32 +0000 (12:22 -0700)] 
Update cascades.rst (#10918)

"delete-cascade" → "delete-orphan"

(cherry picked from commit d0bcf95cb022934d101aa94411f320c4e3bfb6aa)

18 months agoCorrect type hint for FunctionElement.table_valued()
Martijn Pieters [Tue, 16 Jan 2024 12:03:09 +0000 (07:03 -0500)] 
Correct type hint for FunctionElement.table_valued()

### Description

The documentation and the type annotations for `TableValueType()` clearly
state that both strings and column expression arguments are accepted
but the annotation omits `str`, which is the most common use case.

### Checklist
This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

Closes: #10886
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10886
Pull-request-sha: 624a97f051b378516518a30d88e7f216456d1c50

Change-Id: I2a1d2eb9b70815c33a27dd238ff2a9f11e5f5a64
(cherry picked from commit 48d3ad2d90308905709d886fb38dc1de2e2e2478)

18 months agoParse NOT NULL for MySQL generated columns
Georg Wicke-Arndt [Mon, 22 Jan 2024 15:22:43 +0000 (10:22 -0500)] 
Parse NOT NULL for MySQL generated columns

Fixed issue where NULL/NOT NULL would not be properly reflected from a
MySQL column that also specified the VIRTUAL or STORED directives.  Pull
request courtesy Georg Wicke-Arndt.

Fixes: #10850
Closes: #10851
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10851
Pull-request-sha: fb9a81020c393231ca90a1e88342b11cf64414a1

Change-Id: I9a80d0db722c15682e18f0390a7b58e5979e73a1
(cherry picked from commit 14f30b85c7bea7839111bbe54576b290457e3a8d)

18 months agoSupport specifying access method when creating Postgres tables
Edgar Ramírez Mondragón [Mon, 22 Jan 2024 07:29:44 +0000 (02:29 -0500)] 
Support specifying access method when creating Postgres tables

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [x] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

Fixes #10904

**Have a nice day!**

Closes: #10905
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10905
Pull-request-sha: 85f232a303a5543725dac42206cb2395fc34109e

Change-Id: I5e2fc05a696eb6da71bbd695f0466e8552d203b6
(cherry picked from commit 46899918a6dda07cca07e30af2526134f9c38809)