]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
21 months agoMerge "Fix identity column reflection failure" into main
mike bayer [Mon, 23 Oct 2023 18:34:29 +0000 (18:34 +0000)] 
Merge "Fix identity column reflection failure" into main

21 months agoMerge "run declarative scan for non-mapped annotated if allow_unmapped" into main
mike bayer [Mon, 23 Oct 2023 18:31:20 +0000 (18:31 +0000)] 
Merge "run declarative scan for non-mapped annotated if allow_unmapped" into main

21 months agoFix identity column reflection failure
Gord Thompson [Fri, 20 Oct 2023 14:19:42 +0000 (08:19 -0600)] 
Fix identity column reflection failure

Fixes: #10504
Fix reflection failure for bigint identity column with
a large identity start value (more than 18 digits).

Change-Id: I8a7ec114e4596b1710d789a4a4fb08013edd80ce

21 months agoMerge "Remove compare_against_backend" into main
mike bayer [Fri, 20 Oct 2023 18:14:02 +0000 (18:14 +0000)] 
Merge "Remove compare_against_backend" into main

21 months agorun declarative scan for non-mapped annotated if allow_unmapped
Mike Bayer [Fri, 20 Oct 2023 14:19:35 +0000 (10:19 -0400)] 
run declarative scan for non-mapped annotated if allow_unmapped

Fixed issue where the ``__allow_unmapped__`` directive failed to allow for
legacy :class:`.Column` / :func:`.deferred` mappings that nonetheless had
annotations such as ``Any`` or a specific type without ``Mapped[]`` as
their type, without errors related to locating the attribute name.

issue is not ticketed yet but is coming

Fixes: #10516
Change-Id: I471d6838f4dcc113addd284a39a5bb0b885b64ea

21 months agoMerge "dont write dupe idents w different drivers in the idents file" into main
mike bayer [Fri, 20 Oct 2023 18:13:09 +0000 (18:13 +0000)] 
Merge "dont write dupe idents w different drivers in the idents file" into main

21 months agoMerge "manufacture empty result for DELETE..RETURNING w/ no description" into main
mike bayer [Fri, 20 Oct 2023 17:49:15 +0000 (17:49 +0000)] 
Merge "manufacture empty result for DELETE..RETURNING w/ no description" into main

21 months agodont write dupe idents w different drivers in the idents file
Mike Bayer [Fri, 20 Oct 2023 17:31:15 +0000 (13:31 -0400)] 
dont write dupe idents w different drivers in the idents file

Change-Id: I474b40327fcc40a8a6eb4c537a4b80f0eea37162

21 months agoMerge "dont mis-render value from previous loop iteration" into main
mike bayer [Fri, 20 Oct 2023 17:08:44 +0000 (17:08 +0000)] 
Merge "dont mis-render value from previous loop iteration" into main

21 months agoMerge "revise argument to mysqlclient/pymysql ping" into main
mike bayer [Fri, 20 Oct 2023 13:27:07 +0000 (13:27 +0000)] 
Merge "revise argument to mysqlclient/pymysql ping" into main

21 months agoMerge "add aioodbc support for SQL Server" into main
mike bayer [Thu, 19 Oct 2023 17:06:43 +0000 (17:06 +0000)] 
Merge "add aioodbc support for SQL Server" into main

21 months agoMerge "fix AsyncSession.close_all()" into main
Federico Caselli [Thu, 19 Oct 2023 17:05:58 +0000 (17:05 +0000)] 
Merge "fix AsyncSession.close_all()" into main

21 months agoDoc: Update doc/build/tutorial/data_select.rst (#10506)
AmirSoroush [Thu, 19 Oct 2023 16:44:26 +0000 (19:44 +0300)] 
Doc: Update doc/build/tutorial/data_select.rst (#10506)

Removed an extra "that" in a sentence.

21 months agomanufacture empty result for DELETE..RETURNING w/ no description
Mike Bayer [Thu, 19 Oct 2023 16:14:14 +0000 (12:14 -0400)] 
manufacture empty result for DELETE..RETURNING w/ no description

Established a workaround for what seems to be an intrinsic issue across
MySQL/MariaDB drivers where a RETURNING result for DELETE DML which returns
no rows using SQLAlchemy's "empty IN" criteria fails to provide a
cursor.description, which then yields result that returns no rows,
leading to regressions for the ORM that in the 2.0 series uses RETURNING
for bulk DELETE statements for the "synchronize session" feature. To
resolve, when the specific case of "no description when RETURNING was
given" is detected, an "empty result" with a correct cursor description is
generated and used in place of the non-working cursor.

Fixes: #10505
Change-Id: Ib56f1ec5746e2b3212e563169353bc023db84099

21 months agodont mis-render value from previous loop iteration
Mike Bayer [Thu, 19 Oct 2023 15:21:26 +0000 (11:21 -0400)] 
dont mis-render value from previous loop iteration

Fixed issue where using the same bound parameter more than once with
``literal_execute=True`` in some combinations with other literal rendering
parameters would cause the wrong values to render due to an iteration
issue.

Fixes: #10142
Change-Id: Idde314006568e3445558f0104aed9d2f4af72b56

21 months agorevise argument to mysqlclient/pymysql ping
Mike Bayer [Tue, 17 Oct 2023 22:54:23 +0000 (18:54 -0400)] 
revise argument to mysqlclient/pymysql ping

Repaired a new incompatibility in the MySQL "pre-ping" routine where the
``False`` argument passed to ``connection.ping()``, which is intended to
disable an unwanted "automatic reconnect" feature,  is being deprecated in
MySQL drivers and backends, and is producing warnings for some versions of
MySQL's native client drivers.  It's removed for mysqlclient, whereas for
PyMySQL and drivers based on PyMySQL, the parameter will be deprecated and
removed at some point, so API introspection is used to future proof against
these various stages of removal.

Fixes: #10492
Change-Id: I8a52428c6f93a03b66a605cb0b85cc5924803d6d
references: #10489

21 months agofix AsyncSession.close_all()
Bryan不可思议 [Wed, 18 Oct 2023 20:31:45 +0000 (16:31 -0400)] 
fix AsyncSession.close_all()

Fixed bug with method :meth:`_asyncio.AsyncSession.close_all`
that was not working correctly.
Also added function :func:`_asyncio.close_all_sessions` that's
the equivalent of :func:`_orm.close_all_sessions`.

Fixes: #10421
Closes: #10429
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10429
Pull-request-sha: a35c29d41213bd79bfa73ac559a29035ca4e9eb9

Change-Id: If2c3f0130a71b239382c2ea11a3436788ee242be

21 months agoRemove compare_against_backend
Federico Caselli [Wed, 18 Oct 2023 17:51:00 +0000 (19:51 +0200)] 
Remove compare_against_backend

Removed unused placeholder method :meth:`.TypeEngine.compare_against_backend`
This method was used by very old versions of Alembic.
See https://github.com/sqlalchemy/alembic/issues/1293 for details.
Follow up of alembic change I6f480711ec94cd4113d3f0ca114d143b49b8d869

Change-Id: I48ba2b26128ba6f74cb0b2c54caa6f7d2a711257

21 months agoMerge "fix(#10056): keep nullable as true for mariadb generated columns" into main
mike bayer [Tue, 17 Oct 2023 13:30:54 +0000 (13:30 +0000)] 
Merge "fix(#10056): keep nullable as true for mariadb generated columns" into main

21 months agofix(#10056): keep nullable as true for mariadb generated columns
indivar [Mon, 16 Oct 2023 18:53:04 +0000 (14:53 -0400)] 
fix(#10056): keep nullable as true for mariadb generated columns

mariaDB does not support setting NOT NULL for generated column
ref: https://mariadb.com/kb/en/generated-columns/#statement-support

added a check in `get_column_specification` for mariadb, checking
if user has not specified nullable set it as True for computed column,
but if user has explicitly set as False raise a compile error.

added testcase for same

<!-- 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:

- [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.

**Have a nice day!**

Closes: #10354
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10354
Pull-request-sha: 68035e0f77884f361bdcad0514ea731814cb1a34

Change-Id: I00188cf899c0a2efe759e06e510243fbdb1a6dcf

21 months agoimplement eager_grouping for expression clauselists
Mike Bayer [Mon, 16 Oct 2023 17:01:42 +0000 (13:01 -0400)] 
implement eager_grouping for expression clauselists

the expression clauselist feature added in #7744 failed to accommodate
this parameter that is used only by the PostgreSQL JSON
operators.

Fixed 2.0 regression caused by :ticket:`7744` where chains of expressions
involving PostgreSQL JSON operators combined with other operators such as
string concatenation would lose correct parenthesization, due to an
implementation detail specific to the PostgreSQL dialect.

Fixes: #10479
Change-Id: Ic168bf6afd8bf1cfa648f2bad22fdd7254feaa34

21 months agoFix `get_one` return value description
Jochen Kupperschmidt [Sat, 14 Oct 2023 19:08:57 +0000 (15:08 -0400)] 
Fix `get_one` return value description

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

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

The `get_one()` method is described as raising an error if no row is found instead of returning `None` (as `get()` does). Also, the return type hint prohibits `None`.

### 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: #10473
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10473
Pull-request-sha: 1cd2c2a2df2c91a303e459c8f0c5dc950d8c7b39

Change-Id: Iaf69b05d99f4ed0df922f34f27be0b46c1410f7e

21 months agoadd aioodbc support for SQL Server
Mike Bayer [Mon, 2 Oct 2023 18:07:29 +0000 (14:07 -0400)] 
add aioodbc support for SQL Server

Added support for the ``aioodbc`` driver implemented for SQL Server,
which builds on top of the pyodbc and general aio* dialect architecture.

Fixes: #6521
Change-Id: Ife0f6e219766e396079437e99b8938692133b291

21 months agoMerge "ensure ClassVar succeeds in cleanup_mapped_str_annotation" into main
mike bayer [Fri, 13 Oct 2023 20:36:11 +0000 (20:36 +0000)] 
Merge "ensure ClassVar succeeds in cleanup_mapped_str_annotation" into main

21 months agoMerge "amend cx_Oracle version checks, setup.cfg to oracle 8" into main
mike bayer [Fri, 13 Oct 2023 20:35:31 +0000 (20:35 +0000)] 
Merge "amend cx_Oracle version checks, setup.cfg to oracle 8" into main

21 months agoensure ClassVar succeeds in cleanup_mapped_str_annotation
Mike Bayer [Fri, 13 Oct 2023 19:27:40 +0000 (15:27 -0400)] 
ensure ClassVar succeeds in cleanup_mapped_str_annotation

Fixed bug in ORM annotated declarative where using a ``ClassVar`` that
nonetheless referred in some way to an ORM mapped class name would fail to
be interpreted as a ``ClassVar`` that's not mapped.

Fixes: #10472
Change-Id: I6606b0f0222ef088e594eb3b0c0653d983d6ff89

21 months agoamend cx_Oracle version checks, setup.cfg to oracle 8
Mike Bayer [Fri, 13 Oct 2023 18:01:07 +0000 (14:01 -0400)] 
amend cx_Oracle version checks, setup.cfg to oracle 8

Fixed issue where the cx_Oracle dialect claimed to support a lower
cx_Oracle version (7.x) than was actually supported in practice within the
2.0 series of SQLAlchemy. The dialect imports symbols that are only in
cx_Oracle 8 or higher, so runtime dialect checks as well as setup.cfg
requirements have been updated to reflect this compatibility.

Fixes: #10470
Change-Id: Ic955c085e2239a632031d5a80a8b9a9c697a88f8

21 months agoVersion 2.0.23 placeholder
Mike Bayer [Thu, 12 Oct 2023 20:52:21 +0000 (16:52 -0400)] 
Version 2.0.23 placeholder

21 months ago- 2.0.22 rel_2_0_22
Mike Bayer [Thu, 12 Oct 2023 20:38:20 +0000 (16:38 -0400)] 
- 2.0.22

21 months agochangelog fix
Mike Bayer [Thu, 12 Oct 2023 20:36:57 +0000 (16:36 -0400)] 
changelog fix

Change-Id: I50b42d61fbfc728f77d15411e41b04df9e0dd766

21 months agorequire python 3.10 or greater for lowercase test
Mike Bayer [Thu, 12 Oct 2023 20:24:32 +0000 (16:24 -0400)] 
require python 3.10 or greater for lowercase test

in 6f710b393a9 we committed tests using lowercase ``list`` with
indexed access.   use only newer Python versions for this test.

Change-Id: Icba0ef1c6b0b8e66e2d2a6c5b7e9fe86ed81deec

21 months agoMerge "improve detection / errors for unknown hashability w/ unique" into main
mike bayer [Thu, 12 Oct 2023 17:34:19 +0000 (17:34 +0000)] 
Merge "improve detection / errors for unknown hashability w/ unique" into main

21 months agoMerge "Make Values().data input covariant with Sequence" into main
mike bayer [Thu, 12 Oct 2023 14:59:36 +0000 (14:59 +0000)] 
Merge "Make Values().data input covariant with Sequence" into main

21 months agoimprove detection / errors for unknown hashability w/ unique
Mike Bayer [Wed, 11 Oct 2023 22:06:17 +0000 (18:06 -0400)] 
improve detection / errors for unknown hashability w/ unique

Fixed issue where calling :meth:`_engine.Result.unique` with a new-style
:func:`.select` query in the ORM, where one or more columns yields values
that are of "unknown hashability", typically when using JSON functions like
``func.json_build_object()`` without providing a type, would fail
internally when the returned values were not actually hashable. The
behavior is repaired to test the objects as they are received for
hashability in this case, raising an informative error message if not. Note
that for values of "known unhashability", such as when the :class:`.JSON`
or :class:`.ARRAY` types are used directly, an informative error message
was already raised.

The "hashabiltiy testing" fix here is applied to legacy :class:`.Query` as
well, however in the legacy case, :meth:`_engine.Result.unique` is used for
nearly all queries, so no new warning is emitted here; the legacy behavior
of falling back to using ``id()`` in this case is maintained, with the
improvement that an unknown type that turns out to be hashable will now be
uniqufied, whereas previously it would not.

Fixes: #10459
Change-Id: I7317d7ee10c129fc1ab3beeb17c66f34eb063d17

21 months agoMerge "include ORDER BY in subquery that has TOP via FETCH" into main
mike bayer [Thu, 12 Oct 2023 14:50:38 +0000 (14:50 +0000)] 
Merge "include ORDER BY in subquery that has TOP via FETCH" into main

21 months agoMake Values().data input covariant with Sequence
Iuri de Silvio [Thu, 12 Oct 2023 12:25:40 +0000 (08:25 -0400)] 
Make Values().data input covariant with Sequence

Fixed typing issue where the argument list passed to :class:`.Values` was
too-restrictively tied to ``List`` rather than ``Sequence``.  Pull request
courtesy Iuri de Silvio.

Fixes: #10451
Closes: #10452
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10452
Pull-request-sha: 7800f0d631f75b716b8870755e5d0a3fbe950277

Change-Id: If631455d049b2308ec42602b72a60a5ede35fa32

21 months agoinclude ORDER BY in subquery that has TOP via FETCH
Mike Bayer [Wed, 11 Oct 2023 19:36:24 +0000 (15:36 -0400)] 
include ORDER BY in subquery that has TOP via FETCH

Fixed bug where the rule that prevents ORDER BY from emitting within
subqueries on SQL Server was not being disabled in the case where the
:meth:`.select.fetch` method were used to limit rows in conjunction with
WITH TIES or PERCENT, preventing valid subqueries with TOP / ORDER BY from
being used.

Fixes: #10458
Change-Id: I5bfab485241ee54de50cc03e222d9d1736089ea8

21 months agodont enter do_executemany if implicit_returning is False
Mike Bayer [Wed, 11 Oct 2023 14:28:34 +0000 (10:28 -0400)] 
dont enter do_executemany if implicit_returning is False

Fixed regression in recently revised "insertmanyvalues" feature (likely
issue :ticket:`9618`) where the ORM would inadvertently attempt to
interpret a non-RETURNING result as one with RETURNING, in the case where
the ``implicit_returning=False`` parameter were applied to the mapped
:class:`.Table`, indicating that "insertmanyvalues" cannot be used if the
primary key values are not provided.

This includes a refinement to insertmanyvalues where we consider
return_defaults() with supplemental_cols to be the same as an explicit
returning(), since that's the purpose of this.  This saves us some
extra exceptions that could be thrown per-dialect if implicit_returning
were set to False in some cases.

Fixed issue within some dialects where the dialect could incorrectly return
an empty result set for an INSERT statement that does not actually return
rows at all, due to artfacts from pre- or post-fetching the primary key of
the row or rows still being present.  Affected dialects included asyncpg,
all mssql dialects.

Fixes: #10453
Change-Id: Ie2e7e4f4cd9180558f9da315d21895347ec6d4f7

21 months agoupdates for mypy 1.6.0
Mike Bayer [Wed, 11 Oct 2023 15:54:26 +0000 (11:54 -0400)] 
updates for mypy 1.6.0

Change-Id: I33b8e2f55b9049ed412dbe1d0ccd5c9e83e4d1d5

21 months agoMerge "Fix typo in Session.get_one() docs" into main
mike bayer [Tue, 10 Oct 2023 17:05:16 +0000 (17:05 +0000)] 
Merge "Fix typo in Session.get_one() docs" into main

21 months agoclarify one-to-one double parent behaviors
Mike Bayer [Tue, 10 Oct 2023 13:55:57 +0000 (09:55 -0400)] 
clarify one-to-one double parent behaviors

includes that single_parent can be set as an additional measure.

Change-Id: I81d7115ddc7b76ee045582b212e662e0c9d41408
References: #10448

21 months agoFix typo in Session.get_one() docs
Jens Troeger [Sat, 7 Oct 2023 06:48:29 +0000 (02:48 -0400)] 
Fix typo in Session.get_one() docs

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

A typo in the docstrings [here](https://docs.sqlalchemy.org/en/20/orm/session_api.html#sqlalchemy.orm.Session.get_one) shows the incorrectly formatted text:

![Screenshot 2023-10-07 at 16 24 19](https://github.com/sqlalchemy/sqlalchemy/assets/12053937/95cbfbfa-dac3-465a-8e27-ec8e2a223117)

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: #10437
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10437
Pull-request-sha: 82ef25ecbc5b39487b5b55bedb43df9c2a57ae2e

Change-Id: I4ae54733c4bd63239fc94a7fd2099bb3896718ca

21 months agoprovide better detail on declared mixins w/ naming conventions
Mike Bayer [Mon, 9 Oct 2023 13:03:42 +0000 (09:03 -0400)] 
provide better detail on declared mixins w/ naming conventions

Fixes: #10441
Change-Id: I392bc725a850616528d32a8b17805e219ff10aa3

21 months agorepair / test repr() for DDL
Iuri de Silvio [Mon, 9 Oct 2023 12:21:01 +0000 (08:21 -0400)] 
repair / test repr() for DDL

Fixed 2.0 regression where the :class:`.DDL` construct would no longer
``__repr__()`` due to the removed ``on`` attribute not being accommodated.
Pull request courtesy Iuri de Silvio.

Fixes: #10443
Closes: #10442
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10442
Pull-request-sha: 76f0484091b6a35e5953b8d13f3c66c0b1baa9b0

Change-Id: Id49afd681a04e0f05014105b8f15fdb66e6594a0

21 months agotry to clarify defaultload option docs
Federico Caselli [Fri, 6 Oct 2023 19:36:50 +0000 (21:36 +0200)] 
try to clarify defaultload option docs

Change-Id: I529279ba5c7b546faf71a63aa680233cc3cae326

21 months agoMerge "enable 3.12 wheels / actions" into main
mike bayer [Fri, 6 Oct 2023 16:55:40 +0000 (16:55 +0000)] 
Merge "enable 3.12 wheels / actions" into main

21 months agoenable 3.12 wheels / actions
Mike Bayer [Wed, 4 Oct 2023 15:55:36 +0000 (11:55 -0400)] 
enable 3.12 wheels / actions

Change-Id: I823dc9378fe2c18c59237f30906c1efc4b041d54

21 months agoFix typos in pooling docs
Stefanie Molin [Fri, 6 Oct 2023 13:39:41 +0000 (09:39 -0400)] 
Fix typos in pooling docs

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

### Description
<!-- Describe your changes in detail -->
- fixed typo in pooling doc that mentioned three items but had a list of 4
- fixed typo "whish" to "wish" in pooling doc

### 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: #10411
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10411
Pull-request-sha: 652ead00466ce2e85bdc2a62f7c69c16da6bb4fc

Change-Id: Ia5f2c5abfb0d76b5222aa883473291bba6df6de0

21 months agoMerge "check fairy for None in pool cleanup" into main
mike bayer [Fri, 6 Oct 2023 13:09:02 +0000 (13:09 +0000)] 
Merge "check fairy for None in pool cleanup" into main

21 months agoBump pypa/cibuildwheel from 2.16.1 to 2.16.2 (#10416)
dependabot[bot] [Wed, 4 Oct 2023 19:54:07 +0000 (21:54 +0200)] 
Bump pypa/cibuildwheel from 2.16.1 to 2.16.2 (#10416)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16.1 to 2.16.2.
- [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.1...v2.16.2)

---
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>
21 months agoMerge "Added an option to permanently close sessions." into main
mike bayer [Wed, 4 Oct 2023 15:02:47 +0000 (15:02 +0000)] 
Merge "Added an option to permanently close sessions." into main

21 months agocheck fairy for None in pool cleanup
Mike Bayer [Wed, 4 Oct 2023 13:42:55 +0000 (09:42 -0400)] 
check fairy for None in pool cleanup

Fixed issue where under some garbage collection / exception scenarios the
connection pool's cleanup routine would raise an error due to an unexpected
set of state, which can be reproduced under specific conditions.

Fixes: #10414
Change-Id: Ie732f23290d0d3d641f37cd2fee55aff5b9d0857

21 months agoMerge "consider indpendent CTE for UPDATE..FROM" into main
mike bayer [Tue, 3 Oct 2023 19:49:25 +0000 (19:49 +0000)] 
Merge "consider indpendent CTE for UPDATE..FROM" into main

21 months agoinclude WriteOnlyMapped, DynamicMapped in abs import lookup
Mike Bayer [Tue, 3 Oct 2023 17:42:35 +0000 (13:42 -0400)] 
include WriteOnlyMapped, DynamicMapped in abs import lookup

Fixed issue where :class:`.Mapped` symbols like :class:`.WriteOnlyMapped`
and :class:`.DynamicMapped` could not be correctly resolved when referenced
as an element of a sub-module in the given annotation, assuming
string-based or "future annotations" style annotations.

Fixes: #10412
Change-Id: I188146a6de7f6f80ec0ebf6e982b7842a78adc54

21 months agoconsider indpendent CTE for UPDATE..FROM
Mike Bayer [Tue, 3 Oct 2023 12:40:06 +0000 (08:40 -0400)] 
consider indpendent CTE for UPDATE..FROM

Fixed issue where referring to a FROM entry in the SET clause of an UPDATE
statement would not include it in the FROM clause of the UPDATE statement,
if that entry were nowhere else in the statement; this occurs currently for
CTEs that were added using :meth:`.Update.add_cte` to provide the desired
CTE at the top of the statement.

Fixes: #10408
Change-Id: I6e3c6ca7a00cc884bda7e0f24c62c34c75134e5b

21 months agoAdded an option to permanently close sessions.
Daniel Krzeminski [Tue, 22 Aug 2023 18:18:48 +0000 (14:18 -0400)] 
Added an option to permanently close sessions.

Set to ``False`` the new parameter :paramref:`_orm.Session.close_is_reset`
will prevent a :class:`_orm.Session` from performing any other
operation after :meth:`_orm.Session.close` has been called.

Added new method :meth:`_orm.Session.reset` that will reset a :class:`_orm.Session`
to its initial state. This is an alias of :meth:`_orm.Session.close`,
unless :paramref:`_orm.Session.close_is_reset` is set to ``False``.

Fixes: #7787
Closes: #10137
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10137
Pull-request-sha: 881241e19b24f34e4553b2d58070bfa99597f4e4

Change-Id: Ic3512874600daff4ed66bb0cd29a3a88f667d258

21 months agoMerge "Add flake8-unused-arguments to catch unused args typos" into main
mike bayer [Mon, 2 Oct 2023 12:25:29 +0000 (12:25 +0000)] 
Merge "Add flake8-unused-arguments to catch unused args typos" into main

21 months agoMerge "Add get_one to Session, AsyncSession, scoped, etc" into main
mike bayer [Sun, 1 Oct 2023 14:28:04 +0000 (14:28 +0000)] 
Merge "Add get_one to Session, AsyncSession, scoped, etc" into main

21 months agoAdd get_one to Session, AsyncSession, scoped, etc
Carlos Sousa [Mon, 25 Sep 2023 17:03:26 +0000 (13:03 -0400)] 
Add get_one to Session, AsyncSession, scoped, etc

Added method :meth:`_orm.Session.get_one` that behaves like
meth:`_orm.Session.get` but raises an exception instead of returning
None`` if no instance was found with the provided primary key.
Pull request courtesy of Carlos Sousa.

Fixed the :paramref:`_asyncio.AsyncSession.get.execution_options` parameter
which was not being propagated to the underlying :class:`_orm.Session` and
was instead being ignored.

Fixes #10292
Closes: #10376
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10376
Pull-request-sha: 70e4505e93905ee3cebc52f828a95c6bf987c9be

Change-Id: I78eb9816c26446757b6c6c171df2e400777a3d36

21 months agoMerge "handle builtins types in annotations with __allow_unmapped__" into main
mike bayer [Sat, 30 Sep 2023 15:12:55 +0000 (15:12 +0000)] 
Merge "handle builtins types in annotations with __allow_unmapped__" into main

21 months agoAdd flake8-unused-arguments to catch unused args typos
Federico Caselli [Wed, 27 Sep 2023 19:01:57 +0000 (21:01 +0200)] 
Add flake8-unused-arguments to catch unused args typos

Change-Id: I85447bf6587074c521c3673d2999a7ce05fefaec

21 months agoinvoke mariadb-connector .rowcount after all statements
Mike Bayer [Thu, 28 Sep 2023 12:58:16 +0000 (08:58 -0400)] 
invoke mariadb-connector .rowcount after all statements

Modified the mariadb-connector driver to pre-load the ``cursor.rowcount``
value for all queries, to suit tools such as Pandas that hardcode to
calling :attr:`.Result.rowcount` in this way. SQLAlchemy normally pre-loads
``cursor.rowcount`` only for UPDATE/DELETE statements and otherwise passes
through to the DBAPI where it can return -1 if no value is available.
However, mariadb-connector does not support invoking ``cursor.rowcount``
after the cursor itself is closed, raising an error instead.  Generic test
support has been added to ensure all backends support the allowing
:attr:`.Result.rowcount` to succceed (that is, returning an integer value
with -1 for "not available") after the result is closed.

This change also restores mariadb-connector to CI including
as part of the "dbdriver" suite; in 366a5e3e2e503a20ef0334fbf9f we had
taken it out of the DBAPI main job.

Additional fixes for the mariadb-connector dialect to support UUID data
values in the result in INSERT..RETURNING statements.

Added rounding to one remaining INSERT..RETURNING with floats test
to allow mariadbconnector to pass (likely similar issue as the one with
UUID but not worth making a new handler)

Fixes: #10396
Change-Id: Ic11b1b5d0c41356863829d0eacbb812d401e8dd1

21 months agohandle builtins types in annotations with __allow_unmapped__
Pascal Corpet [Thu, 28 Sep 2023 18:08:23 +0000 (14:08 -0400)] 
handle builtins types in annotations with __allow_unmapped__

Fixed issue with ``__allow_unmapped__`` declarative option where types that
were declared using collection types such as ``list[SomeClass]`` vs. the
typing construct ``List[SomeClass]`` would fail to be recognized correctly.
Pull request courtesy Pascal Corpet.

Fixes: #10385
Closes: #10390
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10390
Pull-request-sha: f8796965aefc1852d4b1137d04bf811072a1a0e9

Change-Id: I114d29c3c076386508300e979371b0d760b761c7

21 months agoMerge "Type annotations for sqlalchemy.orm.dynamic" into main
Federico Caselli [Thu, 28 Sep 2023 21:01:07 +0000 (21:01 +0000)] 
Merge "Type annotations for sqlalchemy.orm.dynamic" into main

21 months agoType annotations for sqlalchemy.orm.dynamic
Maksim Latysh [Thu, 23 Mar 2023 12:37:40 +0000 (08:37 -0400)] 
Type annotations for sqlalchemy.orm.dynamic

Closes: #9039
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9039
Pull-request-sha: dae9138f8019bf7e2b305ec869734373a997350d

Change-Id: I89a96213558928877abffc450aeeecbbd196aa92

21 months agonext attempt, try building pyodbc from github rather than released
Mike Bayer [Wed, 27 Sep 2023 21:45:05 +0000 (17:45 -0400)] 
next attempt, try building pyodbc from github rather than released

Change-Id: I87b39ae7fdf3d57e1e0c3ccb4e826e733c3c21ce

21 months agoback out pymssql for py312
Mike Bayer [Wed, 27 Sep 2023 21:39:45 +0000 (17:39 -0400)] 
back out pymssql for py312

in ff80019212a5632c9dd01e we opened up for py312.
all the drivers passed except the mssql build as there is no wheel for
pymssql and we have not been able to build that one.

try it with just pyodbc.

Change-Id: I3f792034656de7aee93b77a3525ca41fa00b4f19

21 months agoBump pypa/cibuildwheel from 2.16.0 to 2.16.1 (#10391)
dependabot[bot] [Wed, 27 Sep 2023 20:42:06 +0000 (22:42 +0200)] 
Bump pypa/cibuildwheel from 2.16.0 to 2.16.1 (#10391)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.16.0 to 2.16.1.
- [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.0...v2.16.1)

---
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>
21 months agoopen up py312 for all DBAPIs
Mike Bayer [Wed, 27 Sep 2023 15:27:47 +0000 (11:27 -0400)] 
open up py312 for all DBAPIs

this wont run under jenkins gerrit job but will hit for jenkins_main /
jenkins_dbapi_main.    will merge and then revert if main / github
builds are really tanking

Change-Id: I29e372ad14bd1005c12176db2d837ecd451c0922

21 months agoMerge "accommodate all mapped_column() parameters in Annotated transfer" into main
mike bayer [Tue, 26 Sep 2023 18:41:55 +0000 (18:41 +0000)] 
Merge "accommodate all mapped_column() parameters in Annotated transfer" into main

22 months agoRevise / rewrite sentences that use the phrase "referred towards"
Eric Hanchrow [Wed, 20 Sep 2023 21:02:08 +0000 (17:02 -0400)] 
Revise / rewrite sentences that use the phrase "referred towards"

Comments by Mike <mike_mp@zzzcomputing.com>:

"Referred towards" is not correct English and can be replaced directly
with "referred to".  However, this then introduces a dangling
preposition to sentences which I don't think is appropriate for this
style of writing.  So instead, use phrases like "known as",
"references", "to which X refers".

To help me identify dangling prepositions I made use of ChatGPT,
here's the log of how that transpired:
https://chat.openai.com/share/60d42ff4-c1ac-4232-893a-415c2b6d7320

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Closes: #10210
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10210
Pull-request-sha: 5d30e79c14fe78996d332fefd4bae36d76626ff4

Change-Id: Ib6a98e5be441f5b25d3929a2efb7d873bcfef98e

22 months agoaccommodate all mapped_column() parameters in Annotated transfer
Mike Bayer [Tue, 19 Sep 2023 21:57:50 +0000 (17:57 -0400)] 
accommodate all mapped_column() parameters in Annotated transfer

Fixed a wide range of :func:`_orm.mapped_column` parameters that were not
being transferred when using the :func:`_orm.mapped_column` object inside
of a pep-593 ``Annotated`` object, including
:paramref:`_orm.mapped_column.sort_order`,
:paramref:`_orm.mapped_column.deferred`,
:paramref:`_orm.mapped_column.autoincrement`,
:paramref:`_orm.mapped_column.system`, :paramref:`_orm.mapped_column.info`
etc.

Additionally, it remains not supported to have dataclass arguments, such as
:paramref:`_orm.mapped_column.kw_only`,
:paramref:`_orm.mapped_column.default_factory` etc. indicated within the
:func:`_orm.mapped_column` received by ``Annotated``, as this is not
supported with pep-681 Dataclass Transforms.  A warning is now emitted when
these parameters are used within ``Annotated`` in this way (and they
continue to be ignored).

Fixes: #10369
Fixes: #10046
Change-Id: Ibcfb287cba0e764db0ae15fab8049bbb9f94dd1b

22 months agoMerge "adjust view definition reflection test for pg16" into main
mike bayer [Wed, 20 Sep 2023 20:45:55 +0000 (20:45 +0000)] 
Merge "adjust view definition reflection test for pg16" into main

22 months agoBump pypa/cibuildwheel from 2.15.0 to 2.16.0 (#10371)
dependabot[bot] [Wed, 20 Sep 2023 19:41:51 +0000 (21:41 +0200)] 
Bump pypa/cibuildwheel from 2.15.0 to 2.16.0 (#10371)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.15.0 to 2.16.0.
- [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.15.0...v2.16.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
22 months agoadjust view definition reflection test for pg16
Mike Bayer [Wed, 20 Sep 2023 17:43:21 +0000 (13:43 -0400)] 
adjust view definition reflection test for pg16

Change-Id: Idd45f8f9dab14bfb0e3f69e82e8c7898ab7d87ba

22 months agoEnsure loader criteria used for ORM join with expression condition
Mike Bayer [Tue, 19 Sep 2023 12:58:52 +0000 (08:58 -0400)] 
Ensure loader criteria used for ORM join with expression condition

Fixed bug where ORM :func:`_orm.with_loader_criteria` would not apply
itself to a :meth:`_sql.Select.join` where the ON clause were given as a
plain SQL comparison, rather than as a relationship target or similar.

Fixes: #10365
Change-Id: Ie6d08fb01a3079b7c3ccd3a8241031d46a56e19d

22 months agoVersion 2.0.22 placeholder
Mike Bayer [Mon, 18 Sep 2023 21:15:13 +0000 (17:15 -0400)] 
Version 2.0.22 placeholder

22 months ago- 2.0.21 rel_2_0_21
Mike Bayer [Mon, 18 Sep 2023 21:02:11 +0000 (17:02 -0400)] 
- 2.0.21

22 months agomore doc fixes
Mike Bayer [Mon, 18 Sep 2023 21:00:49 +0000 (17:00 -0400)] 
more doc fixes

Change-Id: I081f59dd687d6230d2a15a6e068938bc5dd52595

22 months agodoc fixes
Mike Bayer [Mon, 18 Sep 2023 20:43:31 +0000 (16:43 -0400)] 
doc fixes

Change-Id: I97f4985ccfcaaa6da75ff89defe0dd62c61d0559

22 months agoMerge "Update type annotations for loading options" into main
mike bayer [Mon, 18 Sep 2023 20:15:48 +0000 (20:15 +0000)] 
Merge "Update type annotations for loading options" into main

22 months agoMerge "parse for parenthesis in referenced tablename, columnname" into main
mike bayer [Mon, 18 Sep 2023 20:15:10 +0000 (20:15 +0000)] 
Merge "parse for parenthesis in referenced tablename, columnname" into main

22 months agoparse for parenthesis in referenced tablename, columnname
Mike Bayer [Tue, 12 Sep 2023 15:05:48 +0000 (11:05 -0400)] 
parse for parenthesis in referenced tablename, columnname

Fixed a series of reflection issues affecting the PostgreSQL,
MySQL/MariaDB, and SQLite dialects when reflecting foreign key constraints
where the target column contained parenthesis in one or both of the table
name or column name.

Fixes: #10275
Change-Id: Ia2393d45416af6b36e7cab4ee10c2ade7a7e49b3

22 months agoMerge "consider _ClassStrategyLoad as part of endpoint path" into main
mike bayer [Mon, 18 Sep 2023 17:44:37 +0000 (17:44 +0000)] 
Merge "consider _ClassStrategyLoad as part of endpoint path" into main

22 months agoUpdate type annotations for loading options
Janek Nouvertné [Wed, 16 Aug 2023 15:01:39 +0000 (11:01 -0400)] 
Update type annotations for loading options

Update type annotations for ORM loading options, restricting them to accept
only `"*"` instead of any string for string arguments.  Pull request
courtesy Janek Nouvertné.

Fixes: #10131
Closes: #10133
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10133
Pull-request-sha: 08793ed5bfbffbc8688a2573f021e834fc7de367

Change-Id: I33bb93d36cd1eb9d8c7390ed0e94a784e0b8af46

22 months agoFix typing to ensure that InstrumentedAttribute is hashable
Federico Caselli [Sat, 16 Sep 2023 09:06:17 +0000 (11:06 +0200)] 
Fix typing to ensure that InstrumentedAttribute is hashable

Repaired the core "SQL element" class ``SQLCoreOperations`` to support the
``__hash__()`` method from a typing perspective, as objects like
:class:`.Column` and ORM :class:`.InstrumentedAttribute` are hashable and
are used as dictionary keys in the public API for the :class:`_dml.Update`
and :class:`_dml.Insert` constructs.  Previously, type checkers were not
aware the root SQL element was hashable.

Fixes: #10353
Change-Id: I3c8eeb7ceb29a3087596e17d09aa6a7f45a8cf99

22 months agoconsider _ClassStrategyLoad as part of endpoint path
Mike Bayer [Thu, 14 Sep 2023 14:48:03 +0000 (10:48 -0400)] 
consider _ClassStrategyLoad as part of endpoint path

Added new capability to the :func:`_orm.selectin_polymorphic` loader option
which allows other loader options to be bundled as siblings, referring to
one of its subclasses, within the sub-options of parent loader option.
Previously, this pattern was only supported if the
:func:`_orm.selectin_polymorphic` were at the top level of the options for
the query.   See new documentation section for example.

As part of this change, improved the behavior of the
:meth:`_orm.Load.selectin_polymorphic` method / loader strategy so that the
subclass load does not load most already-loaded columns from the parent
table, when the option is used against a class that is already being
relationship-loaded.  Previously, the logic to load only the subclass
columns worked only for a top level class load.

Fixes: #10348
Change-Id: I13a8cad5484e97b2ab51402f100193cb054e2155

22 months agosql/sqltypes/Enum: explicitly document values_callable order (#10248)
Huw Jones [Sat, 16 Sep 2023 09:41:16 +0000 (10:41 +0100)] 
sql/sqltypes/Enum: explicitly document values_callable order (#10248)

Fixes #9911

22 months agoupdate PR template
Federico Caselli [Sat, 16 Sep 2023 08:34:08 +0000 (10:34 +0200)] 
update PR template

include small typing fixes in the cases that don't need an issue

Change-Id: Ibe17267bde0b7a747e1a50ca43124f3a661c6a99

22 months agoFix the type annotation of MetaData.reflect's argument `only` (#10352)
Markus Hauru [Sat, 16 Sep 2023 08:31:43 +0000 (10:31 +0200)] 
Fix the type annotation of MetaData.reflect's argument `only` (#10352)

22 months agoMerge "Add support for SQL string aggregation function aggregate_strings." into main
mike bayer [Fri, 15 Sep 2023 12:28:28 +0000 (12:28 +0000)] 
Merge "Add support for SQL string aggregation function aggregate_strings." into main

22 months agoAdd support for SQL string aggregation function aggregate_strings.
Joshua Morris [Tue, 11 Jul 2023 06:21:37 +0000 (02:21 -0400)] 
Add support for SQL string aggregation function aggregate_strings.

Add support for SQL string aggregation function :class:`.aggregate_strings`.
Pull request curtesy Joshua Morris.

Fixes #9873
Closes: #9892
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9892
Pull-request-sha: 0f4f83bade675f2ff734579fc411d0b354e5a4e6

Change-Id: I6e4afc83664a142e3b1e245978b08a200b6d03d9

22 months agoMerge "qualify hashlib.md5() with usedforsecurity=False" into main
mike bayer [Thu, 14 Sep 2023 15:49:37 +0000 (15:49 +0000)] 
Merge "qualify hashlib.md5() with usedforsecurity=False" into main

22 months agoMerge "Improve the GUID typedecorator example" into main
mike bayer [Thu, 14 Sep 2023 15:48:09 +0000 (15:48 +0000)] 
Merge "Improve the GUID typedecorator example" into main

22 months agoMerge "remove unused type ignores" into main
mike bayer [Thu, 14 Sep 2023 15:46:16 +0000 (15:46 +0000)] 
Merge "remove unused type ignores" into main

22 months agoMerge "allow any key for naming_convention dict, typing is not possible" into main
mike bayer [Thu, 14 Sep 2023 15:46:10 +0000 (15:46 +0000)] 
Merge "allow any key for naming_convention dict, typing is not possible" into main

22 months agoFix Existing.select_from type definition
Federico Caselli [Tue, 12 Sep 2023 20:08:25 +0000 (22:08 +0200)] 
Fix Existing.select_from type definition

Fixed typing issue with :meth:`_sql.Existing.select_from` that
prevented its use with ORM classes.

Fixes: #10337
Change-Id: I4324c09054803f0b1ae7c4bde202cad0b55e1a4f

22 months agoremove unused type ignores
Federico Caselli [Tue, 12 Sep 2023 19:56:15 +0000 (21:56 +0200)] 
remove unused type ignores

Change-Id: Id212e8b4ff7427872ead8fd409a68408813f7d76

22 months agoqualify hashlib.md5() with usedforsecurity=False
Mike Bayer [Tue, 12 Sep 2023 16:24:14 +0000 (12:24 -0400)] 
qualify hashlib.md5() with usedforsecurity=False

Qualified the use of ``hashlib.md5()`` within the DDL compiler, which is
used to generate deterministic four-character suffixes for long index and
constraint names in DDL statements, to include the Python 3.9+
``usedforsecurity=False`` parameter so that Python interpreters built for
restricted environments such as FIPS do not consider this call to be
related to security concerns.

Fixes: #10342
Change-Id: I3af0d3de3d140663c70921ab1ed4b66ad9512ec4

22 months agoBump docker/setup-qemu-action from 2 to 3 (#10343)
dependabot[bot] [Tue, 12 Sep 2023 18:53:53 +0000 (20:53 +0200)] 
Bump docker/setup-qemu-action from 2 to 3 (#10343)

Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>