]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
11 months agoMention no_autoflush in warning
Federico Caselli [Thu, 31 Oct 2024 21:14:57 +0000 (22:14 +0100)] 
Mention no_autoflush in warning

References: #12049
Change-Id: I057140b2fe2f5fc60d5d27a79ddf19a6196fff7b
(cherry picked from commit b4fdfd489755848f4945c31f0686ad9eaf128b08)

11 months agoImprove mutable typing.
Federico Caselli [Wed, 30 Oct 2024 20:17:45 +0000 (21:17 +0100)] 
Improve mutable typing.

References: #12046
Change-Id: If950f7e2090a0f637c2c28cf21a40dc345acc89a
(cherry picked from commit 732698427e822b6ba81f1214864685903cdc13a4)

11 months agoUpdate declarative_styles.rst: add missing import from typing in the example (#12034)
Dennis Magnusson [Wed, 30 Oct 2024 17:33:40 +0000 (19:33 +0200)] 
Update declarative_styles.rst: add missing import from typing in the example (#12034)

* Update declarative_styles.rst: add missing import

* Update declarative_styles.rst: make import statement style consistent

(cherry picked from commit f418ac8d38a26936aa9a8ed9befe210c88b97f33)

11 months agoUpdate bigquery dialect link (#12048)
Gord Thompson [Wed, 30 Oct 2024 17:30:40 +0000 (11:30 -0600)] 
Update bigquery dialect link (#12048)

(cherry picked from commit 58822b9e2412dfefdced95164943fdb515e2f52c)

11 months agoAdd TiDB dialect (#12025)
JaySon [Wed, 23 Oct 2024 16:48:59 +0000 (00:48 +0800)] 
Add TiDB dialect (#12025)

* Add sqlalchemy-tidb to index.rst

* Update index.rst

(cherry picked from commit a9a85f8b2167d7a4313ea49b76e1b2a01a346d7f)

11 months agorefine in_() check to use proper duck-typing for __clause_element__
Mike Bayer [Mon, 21 Oct 2024 14:03:01 +0000 (10:03 -0400)] 
refine in_() check to use proper duck-typing for __clause_element__

Fixed regression caused by an internal code change in response to recent
Mypy releases that caused the very unusual case of a list of ORM-mapped
attribute expressions passed to :meth:`.ColumnOperators.in_` to no longer
be accepted.

in this commit we had to revisit d8dd28c42e where mypy typing
didn't accept ColumnOperartors.   the type here is the _HasClauseElement[_T]
protocol which means we need to use a duck type for a runtime check.

Fixes: #12019
Change-Id: Ib378e9cb8defb49d5ac4d726ec93d6bdc581b6a9
(cherry picked from commit aaddd7c8403e9ca2f77113467b5e2ae279a542c4)

11 months agopin older pip for tox under py37
Mike Bayer [Mon, 21 Oct 2024 17:10:54 +0000 (13:10 -0400)] 
pin older pip for tox under py37

this is suddenly failing due to a non-py37 syntax in
pip/_vendor/typing_extensions.py.  Not clear why the failure has just
started however as there is no new version of pip recently.

Change-Id: I783e2341424a1dad206a7ab668900475fd8d30c5

11 months agoVersion 2.0.37 placeholder
Mike Bayer [Tue, 15 Oct 2024 19:42:11 +0000 (15:42 -0400)] 
Version 2.0.37 placeholder

11 months ago- 2.0.36 rel_2_0_36
Mike Bayer [Tue, 15 Oct 2024 19:28:23 +0000 (15:28 -0400)] 
- 2.0.36

11 months agochangelog updates for 2.0.36
Mike Bayer [Tue, 15 Oct 2024 19:19:44 +0000 (15:19 -0400)] 
changelog updates for 2.0.36

Change-Id: Iffaa6c5556d7b41c8a7537333b7ea58d83ce4771
(cherry picked from commit 4ec37835a66192271171fbba3b6b178641902a18)

11 months agoMerge "add tests for pickling types inside an expression, some reduce methods" into...
Michael Bayer [Tue, 15 Oct 2024 19:06:55 +0000 (19:06 +0000)] 
Merge "add tests for pickling types inside an expression, some reduce methods" into rel_2_0

11 months agoMerge "match ORM mapped cols to PK in interpret_returning_rows" into rel_2_0
Michael Bayer [Tue, 15 Oct 2024 17:41:51 +0000 (17:41 +0000)] 
Merge "match ORM mapped cols to PK in interpret_returning_rows" into rel_2_0

11 months agoadd tests for pickling types inside an expression, some reduce methods
Mike Bayer [Tue, 15 Oct 2024 12:20:25 +0000 (08:20 -0400)] 
add tests for pickling types inside an expression, some reduce methods

Fixed regression from 1.4 where some datatypes such as those derived from
:class:`.TypeDecorator` could not be pickled when they were part of a
larger SQL expression composition due to internal supporting structures
themselves not being pickleable.

Fixes: #12002
Change-Id: I016e37b0c62071413f24c9aac35f6ecf475becaa
(cherry picked from commit fa568215788c274eb2d178b6eb180ab1f7955c01)

11 months agoMerge "Add hash to field-like methods" into rel_2_0
Michael Bayer [Tue, 15 Oct 2024 15:45:55 +0000 (15:45 +0000)] 
Merge "Add hash to field-like methods" into rel_2_0

11 months agomatch ORM mapped cols to PK in interpret_returning_rows
Mike Bayer [Mon, 14 Oct 2024 15:15:21 +0000 (11:15 -0400)] 
match ORM mapped cols to PK in interpret_returning_rows

Fixed bug in ORM "update with WHERE clause" feature where an explicit
``.returning()`` would interfere with the "fetch" synchronize strategy due
to an assumption that the ORM mapped class featured the primary key columns
in a specific position within the RETURNING.  This has been fixed to use
appropriate ORM column targeting.

the _interpret_returning_rows method looked to be mostly not used as far
as its joined inheritance features, which appear to have never been
used as joined inheritance mappers are skipped.

Fixes: #11997
Change-Id: I38fe3a84cdeb2eef38fe00d8b9a6a2b56f434bc6
(cherry picked from commit 553d02b30eba13f3db4595d7a15e51222f864e13)

11 months agoMerge "Render bind cast in json and jsonb in PG" into rel_2_0
Michael Bayer [Tue, 15 Oct 2024 13:36:20 +0000 (13:36 +0000)] 
Merge "Render bind cast in json and jsonb in PG" into rel_2_0

11 months agoMerge "update for mypy 1.12.0" into rel_2_0
Michael Bayer [Tue, 15 Oct 2024 13:34:17 +0000 (13:34 +0000)] 
Merge "update for mypy 1.12.0" into rel_2_0

11 months agoupdate for mypy 1.12.0
Mike Bayer [Tue, 15 Oct 2024 00:21:40 +0000 (20:21 -0400)] 
update for mypy 1.12.0

Change-Id: I8ab16e439a27b3072402beb2c09f715047362c94
(cherry picked from commit d8dd28c42eaffca1cd964a4ab8378c592332e41e)

11 months agoRender bind cast in json and jsonb in PG
Federico Caselli [Sun, 13 Oct 2024 16:32:46 +0000 (18:32 +0200)] 
Render bind cast in json and jsonb in PG

Render bind cast for ``JSON`` and ``JSONB`` datatype on every dialect.
Previously this was only enabled in a subset of dialects.
Fixes: #11994
Change-Id: Ib085deb3e84034dac9e4f4057d32f055d5533e52
(cherry picked from commit b2648e69f2375f7257cbe04b16f663d97795db19)

11 months agoconsult allow_partial_pks for NULL check in lazyload
Mike Bayer [Sun, 13 Oct 2024 14:04:23 +0000 (10:04 -0400)] 
consult allow_partial_pks for NULL check in lazyload

Refined the check which the ORM lazy loader uses to detect "this would be
loading by primary key and the primary key is NULL, skip loading" to take
into account the current setting for the
:paramref:`.orm.Mapper.allow_partial_pks` parameter. If this parameter is
False, then a composite PK value that has partial NULL elements should also
be skipped.   This can apply to some composite overlapping foreign key
configurations.

Fixes: #11995
Change-Id: Icf9a52b7405d7400d46bfa944edcbff1a89225a3
(cherry picked from commit 830debc30896203bfd21fea18d323c5d849068d1)

11 months agoOptimize MySQL foreign key reflection
Federico Caselli [Sat, 12 Oct 2024 12:58:26 +0000 (14:58 +0200)] 
Optimize MySQL foreign key reflection

Improved foreign keys reflection logic in MySQL 8+ to use a better
optimized query. The previous query could be quite slow in databases
with a large number of columns.

Fixes: #11975
Change-Id: Ie8bcd810d4b37abf7fd5e497596e0ade52c3f82e
(cherry picked from commit a98d31621d58d45e2a4d74351282cedddcfe85fa)

11 months agoAdd hash to field-like methods
Federico Caselli [Fri, 11 Oct 2024 19:20:15 +0000 (21:20 +0200)] 
Add hash to field-like methods

Added the dataclass field ``hash`` parameter to the orm field-like methods,
like :meth:`_orn.mapped_column`, :meth:`_orm.relationship`, etc.

Fixes: #11923
Change-Id: I80220f6dcd9c42f465d8a4c4ae2e4efa45279ecc
(cherry picked from commit c14111b5bb2c624dd0bcb677fc3c9d811b46a2e7)

11 months agoMerge "Improve error in dataclasses with table" into rel_2_0
Federico Caselli [Thu, 10 Oct 2024 21:55:38 +0000 (21:55 +0000)] 
Merge "Improve error in dataclasses with table" into rel_2_0

11 months agoremove fully tested in ci reference since it's confusing
Federico Caselli [Thu, 10 Oct 2024 20:25:39 +0000 (22:25 +0200)] 
remove fully tested in ci reference since it's confusing

Change-Id: I5d1c14b2c2b3bcbb55861e1c4a90ffafe8ee00fa
(cherry picked from commit 8684c8dda6cde2f470ad16827b09eb6d4bb1c6d8)

11 months agoMerge "Mention that extract.field is used as sql string" into rel_2_0
Federico Caselli [Thu, 10 Oct 2024 19:59:07 +0000 (19:59 +0000)] 
Merge "Mention that extract.field is used as sql string" into rel_2_0

11 months agoImprove error in dataclasses with table
Federico Caselli [Wed, 9 Oct 2024 18:35:16 +0000 (20:35 +0200)] 
Improve error in dataclasses with table

Added a better error when trying to map as dataclass a class while also
manually providing the ``__table__`` attribute.
This usage is currently not supported.

Fixes: #11973
Change-Id: I54c721b3f7447b2f062fa0cfb53b6a88c381df42
(cherry picked from commit 6ae7f2378971b16f024eb5ab851cc4533bc4e61a)

11 months agoMention that extract.field is used as sql string
Federico Caselli [Tue, 10 Sep 2024 16:42:58 +0000 (18:42 +0200)] 
Mention that extract.field is used as sql string

Change-Id: Ieb32e298e8a1df3a31bf3a6e26b1aca381ef7a4f
(cherry picked from commit e79517d571ab6ab8a2e4e1a9bbd026bbb682df29)

11 months ago_Binary as generic to LargeBinary
Mike Bayer [Thu, 10 Oct 2024 02:05:05 +0000 (22:05 -0400)] 
_Binary as generic to LargeBinary

Datatypes that are binary based such as :class:`.VARBINARY` will resolve to
:class:`.LargeBinary` when the :meth:`.TypeEngine.as_generic()` method is
called.

Fixes: #11978
Change-Id: I2e0586324fb0f1c367da61f0074b35c96fbe2fd0
(cherry picked from commit 858eba6156f210e24d39cc066069a3dac700e33a)

11 months agoMerge "re-apply right memo for nested ORMJoin when splicing" into rel_2_0
Michael Bayer [Thu, 10 Oct 2024 15:12:56 +0000 (15:12 +0000)] 
Merge "re-apply right memo for nested ORMJoin when splicing" into rel_2_0

11 months agoMerge "honor prefetch_cols and postfetch_cols in ORM update w/ WHERE criteria" into...
Michael Bayer [Thu, 10 Oct 2024 15:10:43 +0000 (15:10 +0000)] 
Merge "honor prefetch_cols and postfetch_cols in ORM update w/ WHERE criteria" into rel_2_0

11 months agoBump pypa/cibuildwheel from 2.21.2 to 2.21.3 (#11976)
dependabot[bot] [Wed, 9 Oct 2024 16:42:21 +0000 (18:42 +0200)] 
Bump pypa/cibuildwheel from 2.21.2 to 2.21.3 (#11976)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.2 to 2.21.3.
- [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.21.2...v2.21.3)

---
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 2892aaa108c3fb9d703083579abea938a1ea75a3)

11 months agore-apply right memo for nested ORMJoin when splicing
Mike Bayer [Tue, 8 Oct 2024 14:29:34 +0000 (10:29 -0400)] 
re-apply right memo for nested ORMJoin when splicing

Fixed regression caused by fixes to joined eager loading in
:ticket:`11449`, where a particular joinedload case could not be asserted
correctly.   We now have an example of that case so the assertion has been
repaired to allow for it.

Fixes: #11965
Change-Id: I2e0a594981534f4aaeff361a2f8cf1a0fba8de8f
(cherry picked from commit 43b974a34957f22963e7faf44f0798c8179adcfc)

11 months agoMerge "correct mis-cherry-picked commit for #11449 in 2.0.31" into rel_2_0
Michael Bayer [Wed, 9 Oct 2024 13:15:31 +0000 (13:15 +0000)] 
Merge "correct mis-cherry-picked commit for #11449 in 2.0.31" into rel_2_0

11 months agohonor prefetch_cols and postfetch_cols in ORM update w/ WHERE criteria
Mike Bayer [Wed, 25 Sep 2024 18:19:02 +0000 (14:19 -0400)] 
honor prefetch_cols and postfetch_cols in ORM update w/ WHERE criteria

Continuing from :ticket:`11912`, columns marked with
:paramref:`.mapped_column.onupdate`,
:paramref:`.mapped_column.server_onupdate`, or :class:`.Computed` are now
refreshed in ORM instances when running an ORM enabled UPDATE with WHERE
criteria, even if the statement does not use RETURNING or
populate_existing.

this moves the test we added in #11912 to be in
test_update_delete_where, since this behavior is not related to bulk
statements.    For bulk statements, we're building onto the "many rows
fast" use case and we as yet intentionally don't do any "bookkeeping",
which means none of the expiration or any of that. would need to rethink
"bulk update" a bit to get onupdates to refresh.

Fixes: #11917
Change-Id: I9601be7afed523b356ce47a6daf98cc6584f4ad3
(cherry picked from commit bd1c17f11318d0b581f59c8c6521979246abc9b8)

11 months agofix typo in mapper doc string
Federico Caselli [Tue, 8 Oct 2024 21:22:20 +0000 (23:22 +0200)] 
fix typo in mapper doc string

Change-Id: I10fd7bdb0f0564a5beadfe3fa9fbb7e5ea88362c
(cherry picked from commit 74a8e2ced922183d6ad072eced904cb989113fa2)

11 months agoMerge "Fixed syntax error in mysql function defaults" into rel_2_0
Michael Bayer [Tue, 8 Oct 2024 18:37:43 +0000 (18:37 +0000)] 
Merge "Fixed syntax error in mysql function defaults" into rel_2_0

11 months agocorrect mis-cherry-picked commit for #11449 in 2.0.31
Mike Bayer [Tue, 8 Oct 2024 18:01:40 +0000 (14:01 -0400)] 
correct mis-cherry-picked commit for #11449 in 2.0.31

The main review for #11449 at Ie8f0e8d9bb7958baac33c7c2231e4afae15cf5b1
had three revisions but the cherry pick to 2.0 somehow missed the
second two cherry picks.  it's not clear if this was intentional.
however, as we need to continue on with correcting this behavior
it seems like we really should have the full "main" behavior in
the release.

Fixes: #11449
Change-Id: I1e79c4e0c4843268b2fce7fc2046900bd7b48f00

11 months agoApply fix to reflection of table comments
Gord Thompson [Mon, 7 Oct 2024 12:31:22 +0000 (06:31 -0600)] 
Apply fix to reflection of table comments

Fixes: #11961
Change-Id: Ia3e704973a17cdf5c45bb5b8127435ee562c7d15
(cherry picked from commit 5c48094cbde3cbfaaed0b137ced4887bef14dc29)

11 months agoAdd classifier declaring support for Python 3.13 (#11960)
Hugo van Kemenade [Mon, 7 Oct 2024 16:26:18 +0000 (19:26 +0300)] 
Add classifier declaring support for Python 3.13 (#11960)

(cherry picked from commit afe08a915556f2b1beb5e15aaec770c330ea84a2)

Change-Id: I7c2b6b0ea8a830b63de9dd893bad957fcaf60b17

12 months agoAdd type hints to `sqlalchemy.ext.compiler`
Kevin Kirsche [Wed, 2 Oct 2024 17:06:59 +0000 (13:06 -0400)] 
Add type hints to `sqlalchemy.ext.compiler`

References: #6810
Closes: #11902
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11902
Pull-request-sha: 3a7719ff96c754af2575c5385c8d4fa4d5492113

Change-Id: I29c92ade40d36d186eb37534dc0318f9b2b25840
(cherry picked from commit 0883ee5bf8779edb2ab0ba78f4668ebeb5164781)

12 months agoBump pypa/cibuildwheel from 2.21.1 to 2.21.2 (#11947)
dependabot[bot] [Sat, 5 Oct 2024 07:43:30 +0000 (09:43 +0200)] 
Bump pypa/cibuildwheel from 2.21.1 to 2.21.2 (#11947)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21.1 to 2.21.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.21.1...v2.21.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>
(cherry picked from commit a22545381d72bdebcd506476d07c84913ed37f2c)

12 months agoFixed syntax error in mysql function defaults
huuyafwww [Sat, 5 Oct 2024 06:04:13 +0000 (02:04 -0400)] 
Fixed syntax error in mysql function defaults

Fixed a bug that caused a syntax error when a function was specified
to server_default when creating a column in MySQL or MariaDB.

Fixes #11317
Closes: #11953
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11953
Pull-request-sha: d93ac419a9201134e9c4845dd2e4dc48db4b6f78

Change-Id: I67fc83867df2b7dcf591c8f53b7a97afb90ebba9
(cherry picked from commit 40e990aab3f92051f3c693a81de938ab3b4eb5e4)

12 months agoblock mariadb 1.1.10
Mike Bayer [Tue, 24 Sep 2024 13:35:48 +0000 (09:35 -0400)] 
block mariadb 1.1.10

does not build for any python version

see https://jira.mariadb.org/browse/CONPY-293

Change-Id: I1bf53d79eda7ded017b233f1639aae4bf9578ae6
(cherry picked from commit 833775adc225a358e194092a3cd50be2f52ca8c9)

12 months agoLink scalar result method in scalar_one / scalar_one_or_none
Federico Caselli [Mon, 23 Sep 2024 21:11:06 +0000 (23:11 +0200)] 
Link scalar result method in scalar_one / scalar_one_or_none

References: #11919

Change-Id: Iccbcd3fc3a6143be902683837b36260e5dd31c60
(cherry picked from commit 74e8e777f9aab33830d0625ef03d4a349cab24f4)

12 months agoAdd type annotations to CreateSchema & DropSchema (#11914)
sh-at-cs [Mon, 23 Sep 2024 17:21:40 +0000 (19:21 +0200)] 
Add type annotations to CreateSchema & DropSchema (#11914)

(cherry picked from commit 40ccf772d377ec5f0b07691d3505292ddbbd2435)

12 months agopropagate populate_existing for ORM bulk update
Mike Bayer [Sun, 22 Sep 2024 15:34:48 +0000 (11:34 -0400)] 
propagate populate_existing for ORM bulk update

Similar to #9742

Fixed bug in ORM bulk update/delete where using RETURNING with bulk
update/delete in combination with populate existing would fail to
accommodate the populate_existing option.

Fixes: #11912
Change-Id: Ib9ef659512a1d1ae438eab67332a691941c06f43
(cherry picked from commit 64c1299180c2d944142d54bea741355d474bcbde)

12 months agoadd python 3.13 to pipeline
Federico Caselli [Mon, 5 Aug 2024 21:26:13 +0000 (23:26 +0200)] 
add python 3.13 to pipeline

Change-Id: Id223cfa08b187c2225ea7a6c29817d79474acfc1
(cherry picked from commit 19f145d7f614372b740e7de8dd3ac54e279eb061)
(cherry picked from commit 767e5bf1570684e76e58f5d1b30c9ce158faf88b)

12 months agoUpdated link for the Kinetica dialect (#11895)
am-kinetica [Thu, 19 Sep 2024 20:46:11 +0000 (02:16 +0530)] 
Updated link for the Kinetica dialect (#11895)

(cherry picked from commit a32b917a8836fe0670385c2d11aff58589aefd9c)

12 months agoRemove test warning in python 3.13
Federico Caselli [Tue, 17 Sep 2024 18:22:11 +0000 (20:22 +0200)] 
Remove test warning in python 3.13

Change-Id: Ib098754ef6d157e8dd1eac32b3cb114a9ca66e4a
(cherry picked from commit 0cca754f2101cf0e63f0c67b0220e7a4eb3a0f9c)

12 months agoMAINT: pytest doesn't have any more python 3.12 deprecations
Brigitta Sipőcz [Fri, 13 Sep 2024 20:01:04 +0000 (16:01 -0400)] 
MAINT: pytest doesn't have any more python 3.12 deprecations

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

### Description
<!-- Describe your changes in detail -->
I believe this workaround is not needed any more, pytest doesn't have any more python deprecations. (Arguably neither 3.13)

### 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] Tweek to the (testing) infrastructure
        - New category as I didn't think this PR fit in any of the 3 options offered.

- [ ] 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: #11838
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11838
Pull-request-sha: 7d500de8707cb6d89ba59922d0671afc4062de82

Change-Id: I5fef8ee799fa2dbed1d00f5a779d6b25ce3e5ae8
(cherry picked from commit ffb470cf54c7593e02569102665642be4b85bec2)

12 months agoupdate MonetDB dialect information (#11884)
Yunus Koning [Tue, 17 Sep 2024 18:05:09 +0000 (20:05 +0200)] 
update MonetDB dialect information (#11884)

(cherry picked from commit 8da20140fe2d57584211d85de589cbce7172a2da)

12 months agoBump pypa/cibuildwheel from 2.20.0 to 2.21.1 (#11885)
dependabot[bot] [Tue, 17 Sep 2024 18:02:26 +0000 (20:02 +0200)] 
Bump pypa/cibuildwheel from 2.20.0 to 2.21.1 (#11885)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.20.0 to 2.21.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.20.0...v2.21.1)

---
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>
(cherry picked from commit ea4dcdd3e7a42b16ddeabc78b4f455e37ecdbe7c)

12 months agoVersion 2.0.36 placeholder
Mike Bayer [Mon, 16 Sep 2024 20:30:25 +0000 (16:30 -0400)] 
Version 2.0.36 placeholder

12 months ago- 2.0.35 rel_2_0_35
Mike Bayer [Mon, 16 Sep 2024 20:01:26 +0000 (16:01 -0400)] 
- 2.0.35

12 months agorequire insert_returning for new EagerLoadTest DML suite
Mike Bayer [Mon, 16 Sep 2024 17:43:30 +0000 (13:43 -0400)] 
require insert_returning for new EagerLoadTest DML suite

Change-Id: I354e3ba68ba6efaab6618e514d11355d72652bb5
(cherry picked from commit 52385c44d2bcdc9986d4ec8691cf72342b170dcd)

12 months agoMerge url query args to opts in mariadbconnector like mysqldb
Tobias Petersen [Fri, 13 Sep 2024 18:34:33 +0000 (14:34 -0400)] 
Merge url query args to opts in mariadbconnector like mysqldb

Fixed issue in mariadbconnector dialect where query string arguments that
weren't checked integer or boolean arguments would be ignored, such as
string arguments like ``unix_socket``, etc.  As part of this change, the
argument parsing for particular elements such as ``client_flags``,
``compress``, ``local_infile`` has been made more consistent across all
MySQL / MariaDB dialect which accept each argument. Pull request courtesy
Tobias Alex-Petersen.

Fixes: #11870
Closes: #11869
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11869
Pull-request-sha: 8fdcabc83b548e3fc19aa1625035d43ebc0e1875

Change-Id: I3a11a0e65e118c94928027478409488b0d5e94f8
(cherry picked from commit 5e16d25cc7c32e6cfaea44ceec5a2730d766952c)

12 months agoUpdate index.rst (#11799)
Vitalii Fuglaev [Fri, 13 Sep 2024 20:03:04 +0000 (23:03 +0300)] 
Update index.rst (#11799)

08/28/2024 была обновлена версия sqlalchemy-greenplum в PyPI и сейчас она поддерживает SQLAlchemy 2.0 и выше

(cherry picked from commit 3fbef3b6755503a8369670e4d9439379a52eba8e)

12 months agoFix subquery typos in documentation and changelog (#11807)
Studnikov Dmitry [Fri, 13 Sep 2024 20:01:26 +0000 (23:01 +0300)] 
Fix subquery typos in documentation and changelog (#11807)

* fix: subquery typo

* fix: subquery typo in changelog

---------

Co-authored-by: Dmitry Studnikov <dmitrii.studnikov@mysky.com>
(cherry picked from commit 08c916df4ec21b6929d90b90eb3cfe50343f2260)

12 months agoFix wrong ticket reference in changelog for #11820 (#11867)
Frazer McLean [Fri, 13 Sep 2024 19:57:47 +0000 (21:57 +0200)] 
Fix wrong ticket reference in changelog for #11820 (#11867)

(cherry picked from commit 5959648abc0ff71e38cc12da0261833ea565c154)

12 months agoMerge "fix most broken links" into rel_2_0
Michael Bayer [Fri, 13 Sep 2024 17:20:22 +0000 (17:20 +0000)] 
Merge "fix most broken links" into rel_2_0

12 months agoMerge "MAINT: cleanup the lasts of datetime.utcnow()" into rel_2_0
Michael Bayer [Fri, 13 Sep 2024 17:19:52 +0000 (17:19 +0000)] 
Merge "MAINT: cleanup the lasts of datetime.utcnow()" into rel_2_0

12 months agoFix use of typing.Literal on Python 3.8 and 3.9
Frazer McLean [Thu, 5 Sep 2024 11:29:47 +0000 (07:29 -0400)] 
Fix use of typing.Literal on Python 3.8 and 3.9

Fixed issue where it was not possible to use ``typing.Literal`` with
``Mapped[]`` on Python 3.8 and 3.9.  Pull request courtesy Frazer McLean.

Closes: #11825
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11825
Pull-request-sha: e1e50a97d2a6e0e9ef7ba8dc1a5f07d252e79fa4

Change-Id: Idf04326abcba45813ad555127e81d581a0353587
(cherry picked from commit 509c6d58501679a5844631faf9d7cb751218d7a0)

12 months agoMAINT: cleanup the lasts of datetime.utcnow()
Brigitta Sipőcz [Fri, 6 Sep 2024 06:44:53 +0000 (02:44 -0400)] 
MAINT: cleanup the lasts of datetime.utcnow()

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

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

I'm chasing some loose datetime.datetime.utcnow() deprecation warning in some test suites, and one of these was seemingly coming from sqlalchemy. It wasn't, but nevertheless these minor cleanup changes may still be found useful.

### 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

**Have a nice day!**

Closes: #11736
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11736
Pull-request-sha: 9bee8af8d1082c3cde5f64c78f1e565ef4ab14cd

Change-Id: Ib1b85fa3d66b665165d908e7c8394482b714c57f
(cherry picked from commit 6fefae897a576bce9ec74101e3a5ebcda0557c00)

12 months agodeprecate joinedload, subqueryload with DML; use correct statement
Mike Bayer [Mon, 9 Sep 2024 13:21:20 +0000 (09:21 -0400)] 
deprecate joinedload, subqueryload with DML; use correct statement

An ORM exception is raised if :func:`_orm.joinedload` or
:func:`_orm.subqueryload` are used as a top level option against a
statement that is not a SELECT statement, such as with an
``insert().returning()``.   There are no JOINs in INSERT statements nor is
there a "subquery" that can be repurposed for subquery eager loading, and
for UPDATE/DELETE joinedload does not support these either, so it is never
appropriate for this use to pass silently.

Fixed issue where using eager loaders such as :func:`_orm.selectinload`
with additional criteria in combination with ORM DML such as
:func:`_sql.insert` with RETURNING would not correctly set up internal
contexts required for caching to work correctly, leading to incorrect
results.

Fixes: #11853
Fixes: #11855
Change-Id: Ibbf46ba4f83e472441074c3257e23388e0fcec37
(cherry picked from commit 9ea449bf41006e94273186a974d3a1b091a0552a)

12 months agoMerge "test for Concatenable in ORM evaluator for concat_op" into rel_2_0
Michael Bayer [Mon, 9 Sep 2024 18:35:01 +0000 (18:35 +0000)] 
Merge "test for Concatenable in ORM evaluator for concat_op" into rel_2_0

12 months agotest for Concatenable in ORM evaluator for concat_op
Mike Bayer [Sat, 7 Sep 2024 21:41:16 +0000 (17:41 -0400)] 
test for Concatenable in ORM evaluator for concat_op

Fixed issue in ORM evaluator where two datatypes being evaluated with the
SQL concatenator operator would not be checked for
:class:`.UnevaluatableError` based on their datatype; this missed the case
of :class:`_postgresql.JSONB` values being used in a concatenate operation
which is supported by PostgreSQL as well as how SQLAlchemy renders the SQL
for this operation, but does not work at the Python level. By implementing
:class:`.UnevaluatableError` for this combination, ORM update statements
will now fall back to "expire" when a concatenated JSON value used in a SET
clause is to be synchronized to a Python object.

Fixes: #11849
Change-Id: Iccd97edf57b99b9a606ab3a47d2e3e5b63f0db07
(cherry picked from commit 8b08e9ba2420e856c5073129b351cfd5cf95422b)

12 months agorevert SQLite CHECK constraint changes and add new tests
Mike Bayer [Thu, 5 Sep 2024 17:21:17 +0000 (13:21 -0400)] 
revert SQLite CHECK constraint changes and add new tests

The changes made for SQLite CHECK constraint reflection in versions 2.0.33
and 2.0.34 , :ticket:`11832` and :ticket:`11677`, have now been fully
reverted, as users continued to identify existing use cases that stopped
working after this change.   For the moment, because SQLite does not
provide any consistent way of delivering information about CHECK
constraints, SQLAlchemy is limited in what CHECK constraint syntaxes can be
reflected, including that a CHECK constraint must be stated all on a
single, independent line (or inline on a column definition)  without
newlines, tabs in the constraint definition or unusual characters in the
constraint name.  Overall, reflection for SQLite is tailored towards being
able to reflect CREATE TABLE statements that were originally created by
SQLAlchemy DDL constructs.  Long term work on a DDL parser that does not
rely upon regular expressions may eventually improve upon this situation.
A wide range of additional cross-dialect CHECK constraint reflection tests
have been added as it was also a bug that these changes did not trip any
existing tests.

Fixes: #11840
Change-Id: Iaa4f9651d0c3dd5dbb530ccaa6688169eb7f3bb8
(cherry picked from commit 75ab6b370034e69bc798f9a77751afb200e24f1d)

13 months agocherry-pick changelog update for 1.4.55
Mike Bayer [Thu, 5 Sep 2024 15:54:33 +0000 (11:54 -0400)] 
cherry-pick changelog update for 1.4.55

(cherry picked from commit 7949426428f1ec19381116e025b95f86417a85fc)

13 months agocherry-pick changelog from 1.4.54
Mike Bayer [Thu, 5 Sep 2024 15:54:32 +0000 (11:54 -0400)] 
cherry-pick changelog from 1.4.54

(cherry picked from commit 9a40da5b7785e15f4c4d2f45477154f578b7bddd)

13 months agomove py313 tests to greenlet main
Mike Bayer [Thu, 5 Sep 2024 14:06:36 +0000 (10:06 -0400)] 
move py313 tests to greenlet main

vstinner's branch merged and was immediately deleted from
that repo.  greenlet still not released.  so keep on
chasing it :/

Change-Id: I79927061566db75b4e26b3dbc39b817786531db6
(cherry picked from commit 88dd18cd89598d0569d761db206d4559e8cd57be)

13 months agoFix the runtime issue related to the join operation in the association example (...
BOBOTANG [Wed, 4 Sep 2024 18:26:52 +0000 (02:26 +0800)] 
Fix the runtime issue related to the join operation in the association example (#11721)

(cherry picked from commit e8dfefb97cd43bc03d202872b99931f61324fe80)

13 months agoInclude operators in postgres JSONB documentation (#11828)
Jimmy AUDEBERT [Wed, 4 Sep 2024 17:23:53 +0000 (19:23 +0200)] 
Include operators in postgres JSONB documentation (#11828)

(cherry picked from commit 06ca61066ee312a5198cf1db869f388255212559)

13 months agofix typo in `elect.slice` docs
Federico Caselli [Wed, 4 Sep 2024 17:10:31 +0000 (19:10 +0200)] 
fix typo in `elect.slice` docs

Change-Id: I859b48e320a04cedc6084d067cb20b89ac5d76bb
(cherry picked from commit 6d0379f0565db1b6bf3aa7bead44d759407abadc)

13 months agoVersion 2.0.35 placeholder
Mike Bayer [Wed, 4 Sep 2024 15:19:59 +0000 (11:19 -0400)] 
Version 2.0.35 placeholder

13 months ago- 2.0.34 rel_2_0_34
Mike Bayer [Wed, 4 Sep 2024 15:16:31 +0000 (11:16 -0400)] 
- 2.0.34

13 months agoFix regular expression for `SQLiteDialect.get_check_constraints`
Mike Bayer [Wed, 4 Sep 2024 12:45:52 +0000 (08:45 -0400)] 
Fix regular expression for `SQLiteDialect.get_check_constraints`

Fixed regression in SQLite reflection caused by :ticket:`11677` which
interfered with reflection for CHECK constraints that were followed
by other kinds of constraints within the same table definition.   Pull
request courtesy Harutaka Kawamura.

Fixes: #11832
Closes: #11834
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11834
Pull-request-sha: a10fcef45ccfad6ebf17ec94fc48d0965f0d4123

Change-Id: I50bcc7aa727f73be235895d154cd859f19adda09
(cherry picked from commit 44be2ef4484345298825f547e21d2881cc4921a9)

13 months agouse proper functions to get typing origin, args
Mike Bayer [Wed, 4 Sep 2024 03:08:21 +0000 (23:08 -0400)] 
use proper functions to get typing origin, args

Fixed regression caused by issue :ticket:`11814` which broke support for
certain flavors of :pep:`593` ``Annotated`` in the type_annotation_map when
builtin types such as ``list``, ``dict`` were used without an element type.
While this is an incomplete style of typing, these types nonetheless
previously would be located in the type_annotation_map correctly.

Fixes: #11831
Change-Id: I6ea7fc1bce462d44ffcf67ef18b60050dfc2c91e
(cherry picked from commit e51ff826b9374cadb8eded370a808bc4dcbe56ba)

13 months agoVersion 2.0.34 placeholder
Mike Bayer [Tue, 3 Sep 2024 17:22:38 +0000 (13:22 -0400)] 
Version 2.0.34 placeholder

13 months ago- 2.0.33 rel_2_0_33
Mike Bayer [Tue, 3 Sep 2024 16:56:56 +0000 (12:56 -0400)] 
- 2.0.33

13 months agochangelog categorization fixes, typos
Mike Bayer [Tue, 3 Sep 2024 16:54:22 +0000 (12:54 -0400)] 
changelog categorization fixes, typos

Change-Id: I1292ad4c8a671a98d23861281a8d36e2ab8a6f55
(cherry picked from commit dd835a2a63b0d2fad67ea8ed719e48d6d48229d3)

13 months agoMerge "add asyncio.CancelledError to terminate conditions" into rel_2_0
Michael Bayer [Tue, 3 Sep 2024 14:15:16 +0000 (14:15 +0000)] 
Merge "add asyncio.CancelledError to terminate conditions" into rel_2_0

13 months agoMerge "unpin setuptools" into rel_2_0
Michael Bayer [Mon, 2 Sep 2024 23:44:55 +0000 (23:44 +0000)] 
Merge "unpin setuptools" into rel_2_0

13 months agoMerge "add "The server failed to resume the transaction" to pymssql" into rel_2_0
Michael Bayer [Mon, 2 Sep 2024 23:42:54 +0000 (23:42 +0000)] 
Merge "add "The server failed to resume the transaction" to pymssql" into rel_2_0

13 months agoadd "The server failed to resume the transaction" to pymssql
Mike Bayer [Mon, 2 Sep 2024 15:22:36 +0000 (11:22 -0400)] 
add "The server failed to resume the transaction" to pymssql

Added error "The server failed to resume the transaction" to the list of
error strings for the pymssql driver in determining a disconnect scenario,
as observed by one user using pymssql under otherwise unknown conditions as
leaving an unusable connection in the connection pool which fails to ping
cleanly.

Fixes: #11822
Change-Id: I1cf98046978b10775f19531878b597d32b056f13
(cherry picked from commit ac5a27db854fe9f6fbad5b93130e4a9c19405f3a)

13 months agodont erase transaction if rollback/commit failed outside of asyncpg
Mike Bayer [Mon, 2 Sep 2024 14:37:29 +0000 (10:37 -0400)] 
dont erase transaction if rollback/commit failed outside of asyncpg

Fixed critical issue in the asyncpg driver where a rollback or commit that
fails specifically for the ``MissingGreenlet`` condition or any other error
that is not raised by asyncpg itself would discard the asyncpg transaction
in any case, even though the transaction were still idle, leaving to a
server side condition with an idle transaction that then goes back into the
connection pool.   The flags for "transaction closed" are now not reset for
errors that are raised outside of asyncpg itself.  When asyncpg itself
raises an error for ``.commit()`` or ``.rollback()``, asyncpg does then
discard of this transaction.

Fixes: #11819
Change-Id: I12f0532788b03ea63fb47a7af21e07c37effb070
(cherry picked from commit a1f220cb4d1a04412a53200f454fbfc706e136b3)

13 months agounpin setuptools
Mike Bayer [Mon, 2 Sep 2024 13:13:27 +0000 (09:13 -0400)] 
unpin setuptools

This removes the pin that was placed in 2607262110bdc5c5dc96fc19ddca895a15a58e4e

The pin for ``setuptools<69.3`` in ``pyproject.toml`` has been
removed.  This pin was to prevent a sudden change to :pep:`625` in
setuptools from taking place which changes the file name of SQLAlchemy's
source distribution on pypi to be an all lower case name, which is very
likely to cause problems with various build environments that expected a
particular naming style.  However, the presence of this pin is now holding
back environments that otherwise want to use a newer setuptools, so we've
decided to move forward with this change, with the assumption that build
environments will have largely accommodated the setuptools change by
now.

References: #11818
Change-Id: I0cd9ab0512004669a8f0aa0cb7f560d89a2da2bd
(cherry picked from commit 2b1149e335cb838b31356b6aa33eeb41bfc9a0d1)

13 months agoadd asyncio.CancelledError to terminate conditions
Mike Bayer [Mon, 2 Sep 2024 15:18:35 +0000 (11:18 -0400)] 
add asyncio.CancelledError to terminate conditions

Revising the asyncpg ``terminate()`` fix first made in :ticket:`10717`
which improved the resiliency of this call under all circumstances, adding
``asyncio.CancelledError`` to the list of exceptions that are intercepted
as failing for a graceful ``.close()`` which will then proceed to call
``.terminate()``.

Fixes: #11821
Change-Id: Ic5e21cd18cc5517aae372560c52b2b2396c65483
(cherry picked from commit dc7aec467487f729c3a6d1e9e352626593cf5d67)

13 months agore-process args for builtin generic types
Mike Bayer [Sat, 31 Aug 2024 16:56:00 +0000 (12:56 -0400)] 
re-process args for builtin generic types

Improvements to the ORM annotated declarative type map lookup dealing with
composed types such as ``dict[str, Any]`` linking to JSON (or others) with
or without "future annotations" mode.

There's apparently a big incompatiblity in types from typing vs.
Python builtins in the way they genericize.   The typing library makes
it very difficult to distinguish between the two sets of types.  This
patch is a bit slash and burn to work around all this.   These should
likely be reported as bugs in the Python standard library if they
aren't already.

Fixes: #11814
Change-Id: I56a62701d5e883be04df7f45fd9429bb9c1c9a6f
(cherry picked from commit f746fd78e303352d426a15c1f76ee835ce399d44)

13 months agoMerge "fix select.with_only_columns type hints" into rel_2_0
Michael Bayer [Sat, 31 Aug 2024 15:00:26 +0000 (15:00 +0000)] 
Merge "fix select.with_only_columns type hints" into rel_2_0

13 months agopass to_metadata argument to Enum.copy()
Mike Bayer [Thu, 29 Aug 2024 14:04:47 +0000 (10:04 -0400)] 
pass to_metadata argument to Enum.copy()

Fixed bug where the ``metadata`` element of an ``Enum`` datatype would not
be transferred to the new :class:`.MetaData` object when the type had been
copied via a :meth:`.Table.to_metadata` operation, leading to inconsistent
behaviors within create/drop sequences.

Fixes: #11802
Change-Id: Ibbc93aa31bdfde0d67a9530f41a08e826c17d58e
(cherry picked from commit 22cbc7dcb48c946dda66704797665289965eb22e)

13 months agofix select.with_only_columns type hints
Federico Caselli [Tue, 27 Aug 2024 18:04:52 +0000 (20:04 +0200)] 
fix select.with_only_columns type hints

Fixes: #11782
Change-Id: Idce218a9730986d3ca70547c83aa1c0f8b5ee5b2
(cherry picked from commit 73344fd0d35bd2bf4c4bb8f2a8534a97d7f241af)

13 months agoMerge "Fix memory leak on top-level _ModuleMarker." into rel_2_0
Michael Bayer [Wed, 28 Aug 2024 15:55:11 +0000 (15:55 +0000)] 
Merge "Fix memory leak on top-level _ModuleMarker." into rel_2_0

13 months agoUpdate SQLite UNIQUE inline constraint parsing to handle tabs
John A Stevenson [Mon, 26 Aug 2024 15:05:38 +0000 (11:05 -0400)] 
Update SQLite UNIQUE inline constraint parsing to handle tabs

Improvements to the regex used by the SQLite dialect to reflect the name
and contents of a UNIQUE constraint that is defined inline within a column
definition inside of a SQLite CREATE TABLE statement, accommodating for tab
characters present within the column / constraint line. Pull request
courtesy John A Stevenson.

Fixes: #11746
Closes: #11759
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11759
Pull-request-sha: 5752491154ad19e29abec8d69fa4076d996d964e

Change-Id: I048a90c992bfaf6857c1150f50bf3c6cc5697095
(cherry picked from commit 8071c21b5cb5009b45e8449dcb37b7c3786445e0)

13 months agoFix memory leak on top-level _ModuleMarker.
Federico Caselli [Tue, 27 Aug 2024 17:20:44 +0000 (19:20 +0200)] 
Fix memory leak on top-level _ModuleMarker.

Correctly cleanup the internal top-level module registry when no
inner modules or classes are registered into it.

Fixes: #11788
Change-Id: I489dd6394dd3f14458379368b8c8f18d5a0bb109
(cherry picked from commit 4ae9e65e1d69100e585f783dfe8f2150388b49f4)

13 months agoUpdate link for sqlalchemy-pytds dialect (#11786)
Gord Thompson [Sun, 25 Aug 2024 21:53:59 +0000 (15:53 -0600)] 
Update link for sqlalchemy-pytds dialect (#11786)

(cherry picked from commit 5b117f3d4b38d12d61a39fc60582d4348232334f)

13 months agofix most broken links
Federico Caselli [Sun, 11 Aug 2024 09:55:15 +0000 (11:55 +0200)] 
fix most broken links

This was achieved by running Broken Link Checker
https://github.com/stevenvachon/broken-link-checker
on the docs

Change-Id: Ic415f9435b3c817e518fbbad46ac8fb9e8503d15
(cherry picked from commit 21921a8a94452aed37766645f4d7785d33e6e70f)

13 months agoadd missing slash for sqlite URL with explicit :memory:
Mike Bayer [Wed, 21 Aug 2024 14:49:27 +0000 (10:49 -0400)] 
add missing slash for sqlite URL with explicit :memory:

Fixes: #11772
Change-Id: I3bdb1c81c5a503cb16143c9d1c130ec79769fbca
(cherry picked from commit 663e6f1d60c99fa93da479b4f6f3b3c5e49cc2a8)

13 months agoFix docs link to Oracle Cloud Autonomous Databases (#11762)
Edgar Ramírez Mondragón [Mon, 19 Aug 2024 18:17:54 +0000 (12:17 -0600)] 
Fix docs link to Oracle Cloud Autonomous Databases (#11762)

(cherry picked from commit 89355b82f444e49e0613e4ba8423ffab33e77c38)

13 months agoremove print statement
Mike Bayer [Thu, 15 Aug 2024 12:46:13 +0000 (08:46 -0400)] 
remove print statement

Change-Id: I33c9f7daee1034639bb0725b114f6e48803a4fed
(cherry picked from commit 98836f07f3219ab49aaabeb3a647d9a9799aacd5)

13 months agoMerge "Reflect broader range of check constraints for SQLite." into rel_2_0
Michael Bayer [Thu, 15 Aug 2024 12:38:37 +0000 (12:38 +0000)] 
Merge "Reflect broader range of check constraints for SQLite." into rel_2_0