]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
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 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

13 months agoMerge "omit mysql8 dupe key alias for INSERT..FROM SELECT" into rel_2_0
Michael Bayer [Wed, 14 Aug 2024 14:28:27 +0000 (14:28 +0000)] 
Merge "omit mysql8 dupe key alias for INSERT..FROM SELECT" into rel_2_0

13 months agoMerge "de-memoize _proxy_key when new annotations are added" into rel_2_0
Michael Bayer [Wed, 14 Aug 2024 14:04:54 +0000 (14:04 +0000)] 
Merge "de-memoize _proxy_key when new annotations are added" into rel_2_0

13 months agoMerge "handle quoted_name instances separately in engine.reflection.cache" into rel_2_0
Michael Bayer [Tue, 13 Aug 2024 20:46:07 +0000 (20:46 +0000)] 
Merge "handle quoted_name instances separately in engine.reflection.cache" into rel_2_0

13 months agoReflect broader range of check constraints for SQLite.
Jeff Horemans [Tue, 13 Aug 2024 15:22:51 +0000 (11:22 -0400)] 
Reflect broader range of check constraints for SQLite.

Improvements to the regex used by the SQLite dialect to reflect the name
and contents of a CHECK constraint.  Constraints with newline, tab, or
space characters in either or both the constraint text and constraint name
are now properly reflected.   Pull request courtesy Jeff Horemans.

Fixes: #11677
Closes: #11701
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11701
Pull-request-sha: b2d629f18695ecb08cddeb99d7c2573e1f3d04b2

Change-Id: I2dd06c778e7c130848e418a80004032eb6144e6d
(cherry picked from commit 4c8469947d79766813bc9326ef16c25ff6882f53)

13 months agode-memoize _proxy_key when new annotations are added
Mike Bayer [Mon, 12 Aug 2024 23:50:05 +0000 (19:50 -0400)] 
de-memoize _proxy_key when new annotations are added

Fixed regression from 1.3 where the column key used for a hybrid property
might be populated with that of the underlying column that it returns, for
a property that returns an ORM mapped column directly, rather than the key
used by the hybrid property itself.

Fixes: #11728
Change-Id: Ifb298e46a20f90f6b6a717674f142a87cbceb468
(cherry picked from commit ffc7e8d73b30ea45fb03e0727b9fe96b6b8d4cfa)

13 months agoomit mysql8 dupe key alias for INSERT..FROM SELECT
Mike Bayer [Tue, 13 Aug 2024 13:13:51 +0000 (09:13 -0400)] 
omit mysql8 dupe key alias for INSERT..FROM SELECT

Fixed issue in MySQL dialect where using INSERT..FROM SELECT in combination
with ON DUPLICATE KEY UPDATE would erroneously render on MySQL 8 and above
the "AS new" clause, leading to syntax failures.  This clause is required
on MySQL 8 to follow the VALUES clause if use of the "new" alias is
present, however is not permitted to follow a FROM SELECT clause.

Fixes: #11731
Change-Id: I254a3db4e9dccd9a76b11fdfe6e38a064ba0b5cf
(cherry picked from commit 63b45202848de0cb3cfd41de130000355cbb88ef)

13 months agocherry-pick changelog update for 1.4.54
Mike Bayer [Mon, 29 Jul 2024 16:34:35 +0000 (12:34 -0400)] 
cherry-pick changelog update for 1.4.54

(cherry picked from commit 7ea59f7505a78cd801b48d82a97919a239086f61)

13 months agocherry-pick changelog from 1.4.53
Mike Bayer [Mon, 29 Jul 2024 16:34:34 +0000 (12:34 -0400)] 
cherry-pick changelog from 1.4.53

(cherry picked from commit 551b5135df63386d1540b709e37e86a629c1c25f)

13 months agoturn off pyodbc pooling
Mike Bayer [Sun, 11 Aug 2024 19:41:36 +0000 (15:41 -0400)] 
turn off pyodbc pooling

new updates of unixodbc are turning this on in CI revealing
that our isolation level tests assume no pooling takes place,
so disable this, which is only at global module level for pyodbc

Change-Id: I971dfddc90d248281e8ca8677a3a41af6de28b86
(cherry picked from commit 896dbdb5920ffb645a8948c254f73dd0fcb0d3c0)

13 months agoDocs: Dialects/index.rst - Add clickhouse-sqlalchemy pypi link. (#11717)
Gregg Lind [Fri, 9 Aug 2024 19:56:44 +0000 (14:56 -0500)] 
Docs:  Dialects/index.rst - Add clickhouse-sqlalchemy pypi link. (#11717)

Add the Pypi link for the `clickhouse-sqlalchemy` package to Externally supported dialects.

(cherry picked from commit 081a91535f9229c957c0f40e035eb8c399bf6ab7)

13 months agoFix typo in docs (#11715)
Gabi Nagy [Fri, 9 Aug 2024 19:54:24 +0000 (21:54 +0200)] 
Fix typo in docs (#11715)

(cherry picked from commit 387be54e60e96455de6ecaadf8ff20df8304c760)

14 months agonote prefix_with as a hint mechanism
Mike Bayer [Wed, 7 Aug 2024 18:31:48 +0000 (14:31 -0400)] 
note prefix_with as a hint mechanism

References: #11702
References: #11704
Change-Id: Ieee0780f6d132a29269430fc26de5c0664b16c2e
(cherry picked from commit 6cf5e2a188fc5e337d22a098a5fe9a9fe10cc7e7)

14 months agohandle quoted_name instances separately in engine.reflection.cache
Masterchen09 [Tue, 6 Aug 2024 18:20:51 +0000 (14:20 -0400)] 
handle quoted_name instances separately in engine.reflection.cache

Fixed issue in internal reflection cache where particular reflection
scenarios regarding same-named quoted_name() constructs would not be
correctly cached.  Pull request courtesy Felix Lüdin.

Fixes: #11687
Closes: #11688
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11688
Pull-request-sha: 43d94273a5b13a89226e60de4b958d5b4ac7ff78

Change-Id: I73273dff532a9d14d54065bc33339874e3cb2716
(cherry picked from commit e26e9f123a0afe0a89f7635389764206d15a5f1e)

14 months agorestore generative to with_statement_hint
Mike Bayer [Wed, 7 Aug 2024 16:18:25 +0000 (12:18 -0400)] 
restore generative to with_statement_hint

Fixed regression in :meth:`_sql.Select.with_statement_hint` and others
where the generative behavior of the method stopped producing a copy of the
object.

Fixes: #11703
Change-Id: Ia4482f91f76fae9982dc6b075bf5cfec7042ffa6
(cherry picked from commit a9747467a8b6e8212f758aaceffdc96f087e15bb)

14 months agoMerge "Add array_type to SuiteRequirements" into rel_2_0
Michael Bayer [Wed, 7 Aug 2024 14:14:19 +0000 (14:14 +0000)] 
Merge "Add array_type to SuiteRequirements" into rel_2_0

14 months agodisable recovery tests for oracledb
Mike Bayer [Wed, 7 Aug 2024 13:10:40 +0000 (09:10 -0400)] 
disable recovery tests for oracledb

this is not holding up in CI and is not a critical feature
for now

Change-Id: Ib9547028265403497c176d96c462d76cd86c967a
(cherry picked from commit 3a4f8cd8760a6901880310bef7ced7e4b424d375)

14 months agoFix a misreference in inheritance.rst (#11700)
Tao Zhou [Tue, 6 Aug 2024 20:21:44 +0000 (16:21 -0400)] 
Fix a misreference in inheritance.rst (#11700)

(cherry picked from commit 10ac7ce5c8527240e8cc4fa65f3f7a0ba10a2f26)

14 months agoBump pypa/cibuildwheel from 2.19.2 to 2.20.0 (#11690)
dependabot[bot] [Mon, 5 Aug 2024 21:07:55 +0000 (23:07 +0200)] 
Bump pypa/cibuildwheel from 2.19.2 to 2.20.0 (#11690)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.2 to 2.20.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.19.2...v2.20.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>
(cherry picked from commit 3ac034057ce621379fb8e0926b851a903d2c7e0b)

14 months agoAdd array_type to SuiteRequirements
Anders Bogsnes [Mon, 5 Aug 2024 20:28:48 +0000 (16:28 -0400)] 
Add array_type to SuiteRequirements

Added missing ``array_type`` property to the testing suite
``SuiteRequirements`` class.

Closes: #11694
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11694
Pull-request-sha: 24697f6a4346005aa83d8eb06f94bba4cc994862

Change-Id: I192b5b932dfef07043c0c0cfe8ea36b02425a44d
(cherry picked from commit f52be645d7f5735bba52786b2f417cc0786f138d)

14 months agoadd changelog for #11557
Mike Bayer [Mon, 5 Aug 2024 21:01:08 +0000 (17:01 -0400)] 
add changelog for #11557

also classify for oracle

Change-Id: I725db9c6ae6a8fabe7faf8631113633b338afea4
(cherry picked from commit 7e2615c8c86ffc0247463ba6aeab86b9c4d4a281)

14 months agoVersion 2.0.33 placeholder
Mike Bayer [Mon, 5 Aug 2024 19:08:57 +0000 (15:08 -0400)] 
Version 2.0.33 placeholder

14 months ago- 2.0.32 rel_2_0_32
Mike Bayer [Mon, 5 Aug 2024 19:05:16 +0000 (15:05 -0400)] 
- 2.0.32

14 months agoAdded support for server-side cursor in oracledb async dialect.
Federico Caselli [Thu, 1 Aug 2024 19:16:20 +0000 (21:16 +0200)] 
Added support for server-side cursor in oracledb async dialect.

Added API support for server-side cursors for the oracledb async dialect,
allowing use of the :meth:`_asyncio.AsyncConnection.stream` and similar
stream methods.

Fixes: #10820
Change-Id: I861670ccc20a81ec5ee45132b8059fc2a0359087
(cherry picked from commit ffb2e2d033f8e227b80ba3c5d06c67a96310e1ec)

14 months agochangelog updates
Mike Bayer [Fri, 2 Aug 2024 13:42:59 +0000 (09:42 -0400)] 
changelog updates

Change-Id: I3c319c15d883b88a4ceae2ea17d3122fcc90fb1f
(cherry picked from commit bae75fe92f9636bafb75461ff0bc556432831e30)

14 months agoMerge "skip in eager row processors for enable_eagerloads=False" into rel_2_0
Michael Bayer [Fri, 2 Aug 2024 13:39:15 +0000 (13:39 +0000)] 
Merge "skip in eager row processors for enable_eagerloads=False" into rel_2_0

14 months agoMerge "escape percents for mysql enum and add suite tests" into rel_2_0
Michael Bayer [Fri, 2 Aug 2024 13:38:18 +0000 (13:38 +0000)] 
Merge "escape percents for mysql enum and add suite tests" into rel_2_0

14 months agoMerge "add check for pre-existing history records" into rel_2_0
Michael Bayer [Fri, 2 Aug 2024 13:37:00 +0000 (13:37 +0000)] 
Merge "add check for pre-existing history records" into rel_2_0

14 months agoskip in eager row processors for enable_eagerloads=False
Mike Bayer [Thu, 1 Aug 2024 19:58:57 +0000 (15:58 -0400)] 
skip in eager row processors for enable_eagerloads=False

Fixed issue where using the :meth:`_orm.Query.enable_eagerloads` and
:meth:`_orm.Query.yield_per` methods at the same time, in order to disable
eager loading that's configured on the mapper directly, would be silently
ignored, leading to errors or unexpected eager population of attributes.

Fixes: #10834
Change-Id: I6a20bdedf23f6dd4e98ffb49ad784117fe4afdd3
(cherry picked from commit 0a8bf50422a4c5ce1945aee6d6d37d9467ebf1c1)

14 months agobring oracle timeout thing lower
Mike Bayer [Thu, 1 Aug 2024 23:15:57 +0000 (19:15 -0400)] 
bring oracle timeout thing lower

still seeing failures

we may very well have to revert this and mark oracle as not supporting
recovery

Change-Id: I4d48607cb8579dc73c650f5232e4414a408735e2
(cherry picked from commit fc7b758b7bb707d7931d909702aa019bbba98fce)

14 months agoadd check for pre-existing history records
Mike Bayer [Thu, 1 Aug 2024 20:41:45 +0000 (16:41 -0400)] 
add check for pre-existing history records

Fixed issue in history_meta example where the "version" column in the
versioned table needs to default to the most recent version number in the
history table on INSERT, to suit the use case of a table where rows are
deleted, and can then be replaced by new rows that re-use the same primary
key identity.  This fix adds an additonal SELECT query per INSERT in the
main table, which may be inefficient; for cases where primary keys are not
re-used, the default function may be omitted.  Patch courtesy  Philipp H.
v. Loewenfeld.

Fixes: #10267
Change-Id: I6b0737a7e871763f95fd636c9ad98b80f3b5808e
(cherry picked from commit 6a59eecfa891db84033f5d0c88451b344e5b6f0c)

14 months agoescape percents for mysql enum and add suite tests
Mike Bayer [Thu, 1 Aug 2024 19:51:00 +0000 (15:51 -0400)] 
escape percents for mysql enum and add suite tests

Fixed issue in MySQL dialect where ENUM values that contained percent signs
were not properly escaped for the driver.

Fixes: #11479
Change-Id: I40d9aba619618603d3abb466f84a793d152b6788
(cherry picked from commit 2afb138d310da41d17f9e3dc9fa9339b52e7a9a4)

14 months agoMerge "mutate lists in place for return_defaults=True" into rel_2_0
Michael Bayer [Thu, 1 Aug 2024 19:31:35 +0000 (19:31 +0000)] 
Merge "mutate lists in place for return_defaults=True" into rel_2_0

14 months agoMerge "Add support for two-phase commit in oracledb." into rel_2_0
Michael Bayer [Thu, 1 Aug 2024 17:47:06 +0000 (17:47 +0000)] 
Merge "Add support for two-phase commit in oracledb." into rel_2_0

14 months agomutate lists in place for return_defaults=True
Mike Bayer [Thu, 1 Aug 2024 13:49:55 +0000 (09:49 -0400)] 
mutate lists in place for return_defaults=True

Fixed regression from version 1.4 in
:meth:`_orm.Session.bulk_insert_mappings` where using the
:paramref:`_orm.Session.bulk_insert_mappings.return_defaults` parameter
would not populate the passed in dictionaries with newly generated primary
key values.

Fixes: #11661
Change-Id: I331d81a5b04456f107eb868f882d67773b3eec38
(cherry picked from commit 7001429a7561b3c55dd52b96dfa419004e535743)

14 months agoAdd support for two-phase commit in oracledb.
Federico Caselli [Mon, 10 Jun 2024 19:20:56 +0000 (21:20 +0200)] 
Add support for two-phase commit in oracledb.

Implemented two-phase transactions for the oracledb dialect. Historically,
this feature never worked with the cx_Oracle dialect, however recent
improvements to the oracledb successor now allow this to be possible.  The
two phase transaction API is available at the Core level via the
:meth:`_engine.Connection.begin_twophase` method.

As part of this change, added new facility for testing that allows
a test to skip if a certain step takes too long, allowing for a
separate cleanup step.  this is needed as oracle tpc wont allow
commit recovery if transaction is older than about 1 second, could not
find any docs on how to increase this timeout.

Fixed an execute call in the PostgreSQL dialect's provisioning that
drops old tpc transactions which was non-working, which indicates
that we've apparently never had any PG tpc transactions needing to
be cleaned up in CI for some years now, so that's good

Fixes: #11480
Change-Id: If3ad19cc29999e70f07f767b88afd330f6e5a4be
(cherry picked from commit a9c0487c024410d446b8be3f528e051318dd150e)

14 months agoFixed compilation of bitwise operators on oracle and sqlite.
Federico Caselli [Mon, 29 Jul 2024 21:52:04 +0000 (23:52 +0200)] 
Fixed compilation of bitwise operators on oracle and sqlite.

Implemented bitwise operators for Oracle which was previously
non-functional due to a non-standard syntax used by this database.
Oracle's support for bitwise "or" and "xor" starts with server version 21.
Additionally repaired the implementation of "xor" for SQLite.

As part of this change, the dialect compliance test suite has been enhanced
to include support for server-side bitwise tests; third party dialect
authors should refer to new "supports_bitwise" methods in the
requirements.py file to enable these tests.

Fixes: #11663
Change-Id: I41040bd67992b6c89ed3592edca8965d5d59be9e
(cherry picked from commit ce60f93a68f312c7401802820dd17f5d91f73a2c)

14 months agoadd CTE cache elements for CompoundSelect, more verify tests
Federico Caselli [Fri, 14 Jun 2024 22:06:46 +0000 (00:06 +0200)] 
add CTE cache elements for CompoundSelect, more verify tests

Follow up of :ticket:`11471` to fix caching issue where using the
:meth:`.CompoundSelectState.add_cte` method of the
:class:`.CompoundSelectState` construct would not set a correct cache key
which distinguished between different CTE expressions. Also added tests
that would detect issues similar to the one fixed in :ticket:`11544`.

Fixes: #11471
Change-Id: Iae6a91077c987d83cd70ea826daff42855491330
(cherry picked from commit 881be0a21633b3fee101cb34cc611904b8cba618)

14 months agoImport all legacy classes by sqlalchemy.orm.collections.*
Takashi Kajinami [Mon, 29 Jul 2024 16:01:04 +0000 (12:01 -0400)] 
Import all legacy classes by sqlalchemy.orm.collections.*

Restored legacy class names removed from
``sqlalalchemy.orm.collections.*``, including
:class:`_orm.MappedCollection`, :func:`_orm.mapped_collection`,
:func:`_orm.column_mapped_collection`,
:func:`_orm.attribute_mapped_collection`. Pull request courtesy Takashi
Kajinami.

Fixes: #11435
Closes: #11432
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11432
Pull-request-sha: 66f20a8e2069f48665299d1ee220dfe57aedf79e

Change-Id: I05172669fc9a44e737b3714001d1317bbbf0012f
(cherry picked from commit b6e9ca40bddbd6e670d40bc4ae952e1ee67d8816)

14 months agoadd missing forwards port versions
Mike Bayer [Mon, 29 Jul 2024 15:58:38 +0000 (11:58 -0400)] 
add missing forwards port versions

I totally forgot these meaning they wont show up in 2.0
changelogs, so this is a big mistake i have to stop making

Change-Id: I5f998eecbfa8aceab3ee247bb3a00e13820af872
(cherry picked from commit 1ba11863398153760952261adff08d544a508c3a)

14 months agobackport 1.4 changelogs
Mike Bayer [Mon, 29 Jul 2024 15:33:58 +0000 (11:33 -0400)] 
backport 1.4 changelogs

we have a few issues that were fixed only in 1.4, not yet released.
backport the changelog so that release mechanics proceed without issue

Change-Id: I376aa5c854314e86134c8f935b80d6c0dd083033
(cherry picked from commit 50fbde72d0e6efe0862f780f14a72eb916ea630c)

14 months agorestore transfer of mapper.local_table to DML for some cases
Mike Bayer [Sat, 20 Jul 2024 02:59:35 +0000 (22:59 -0400)] 
restore transfer of mapper.local_table to DML for some cases

Fixed regression appearing in 2.0.21 caused by :ticket:`10279` where using
a :func:`_sql.delete` or :func:`_sql.update` against an ORM class that is
the base of an inheritance hierarchy, while also specifying that subclasses
should be loaded polymorphically, would leak the polymorphic joins into the
UPDATE or DELETE statement as well creating incorrect SQL.

This re-introduces logic to set the `.table` of an ORM update or delete
back to `mapper.local_table` that was removed in d18ccdc997185b74 by
:ticket:`10279`; the logic is qualified to only take place for a
statement that's directly against a mapper and not one that's against
an aliased object.

Fixes: #11625
Change-Id: Ia228c99809370733f111925554167e39bcd6be1d
(cherry picked from commit e82660aba0b9ced0b3c65fd8fc4496e4e371fce0)

14 months agoupdate typing for mypy 1.11; pin plugin to <1.11
Federico Caselli [Mon, 22 Jul 2024 21:17:45 +0000 (23:17 +0200)] 
update typing for mypy 1.11; pin plugin to <1.11

Fixed internal typing issues to establish compatibility with mypy 1.11.0.
Note that this does not include issues which have arisen with the
deprecated mypy plugin used by SQLAlchemy 1.4-style code; see the addiional
change note for this plugin indicating revised compatibility.

The legacy mypy plugin is no longer fully functional with the latest series
of mypy 1.11.0, as changes in the mypy interpreter are no longer compatible
with the approach used by the plugin.  If code is dependent on the legacy
mypy plugin with sqlalchemy2-stubs, it's recommended to pin mypy to be
below the 1.11.0 series.    Seek upgrading to the 2.0 series of SQLAlchemy
and migrating to the modern type annotations.

Change-Id: Ib8fef93ede588430dc0f7ed44ef887649a415821
(cherry picked from commit 156fef61135a55c6ad17765b64155801f1dbea66)

14 months agofix test for oracledb 2.3.0
Mike Bayer [Sat, 27 Jul 2024 03:28:57 +0000 (23:28 -0400)] 
fix test for oracledb 2.3.0

Separate from adding support for 2pc for oracledb, get the test
suite to pass cleanly for all oracledb versions first

Change-Id: I39ba91e81f2afe5e9610a65fdcc88025f207089b
(cherry picked from commit a40aeef5c553212fa227b315c7da7d32fbef933c)

14 months agoadd missing changelog for #11544
Mike Bayer [Sat, 20 Jul 2024 03:05:43 +0000 (23:05 -0400)] 
add missing changelog for #11544

Fixes: #11544
Change-Id: Ibf57f6ee0fee105672b03c2bf6690cad6bb0932d
(cherry picked from commit 800932af467109f06c0196c42ae86272a5d7f96a)

14 months agoremove redundant(?) Isolation / isolation
Mike Bayer [Mon, 15 Jul 2024 13:15:36 +0000 (09:15 -0400)] 
remove redundant(?) Isolation / isolation

References: https://github.com/sqlalchemy/sqlalchemy/discussions/11609
Change-Id: I8ada4b8ed64a6d6b9cb923503fda6d7b4888f429
(cherry picked from commit e44e805506fa71318e23a2bfad733fbbf5a9ee59)

14 months agoinclude nulls_first, nulls_last in order_by_label_element
Mike Bayer [Wed, 10 Jul 2024 14:32:44 +0000 (10:32 -0400)] 
include nulls_first, nulls_last in order_by_label_element

Fixed bug where the :meth:`.Operators.nulls_first()` and
:meth:`.Operators.nulls_last()` modifiers would not be treated the same way
as :meth:`.Operators.desc()` and :meth:`.Operators.asc()` when determining
if an ORDER BY should be against a label name already in the statement. All
four modifiers are now treated the same within ORDER BY.

Fixes: #11592
Change-Id: I1de1aff679c56af1abfdfd07f9bcbc45ecc5a8cc
(cherry picked from commit 96f1172812f858fead45cdc7874abac76f45b339)

15 months agoImprove generated reflection in sqlite
Federico Caselli [Sun, 7 Jul 2024 09:56:56 +0000 (11:56 +0200)] 
Improve generated reflection in sqlite

Fixed reflection of computed column in SQLite to properly account
for complex expressions.

Fixes: #11582
Change-Id: I8e9fdda3e47c04b376973ee245b3175374a08f56
(cherry picked from commit e67a0b77a82667e2199e333bae0606d143fa228e)

15 months agoalter the collation of string type for collate()
Mike Bayer [Fri, 5 Jul 2024 13:30:10 +0000 (09:30 -0400)] 
alter the collation of string type for collate()

Fixed issue where the :func:`_sql.collate` construct, which explicitly sets
a collation for a given expression, would maintain collation settings for
the underlying type object from the expression, causing SQL expressions to
have both collations stated at once when used in further expressions for
specific dialects that render explicit type casts, such as that of asyncpg.
The :func:`_sql.collate` construct now assigns its own type to explicitly
include the new collation, assuming it's a string type.

Fixes: #11576
Change-Id: I6fc8904d2bcbc21f11bbca57e4a451ed0edbd879
(cherry picked from commit 35c178c405c44798810ceac540faf8385b4632c4)

15 months agoensure intro to "functions have types" is not misleading
Mike Bayer [Sat, 6 Jul 2024 16:24:51 +0000 (12:24 -0400)] 
ensure intro to "functions have types" is not misleading

make sure it's clear that there is normally not a return type
for SQL functions

Fixes: #11578
Change-Id: Ia0b66e7fe685dad427822345dd232eb47a0fc44f
(cherry picked from commit e9d3e49601d011f9a3471921729728ca688e04b9)

15 months agoMerge "Fix table reflection on oracle <10.2" into rel_2_0
Michael Bayer [Fri, 5 Jul 2024 14:24:08 +0000 (14:24 +0000)] 
Merge "Fix table reflection on oracle <10.2" into rel_2_0

15 months agoMerge "Allow flat for join with name" into rel_2_0
Federico Caselli [Thu, 4 Jul 2024 20:30:35 +0000 (20:30 +0000)] 
Merge "Allow flat for join with name" into rel_2_0

15 months agoAdded valid types to server_onupdate (#11555)
opkna [Thu, 4 Jul 2024 20:13:10 +0000 (22:13 +0200)] 
Added valid types to server_onupdate (#11555)

* Added valid types to server_onupdate and mapped_column kwargs mypy tests
* Joined mapped_column test files
* Set _ServerOnUpdateArgument to _ServerDefaultArgument

Fixes: #11546
(cherry picked from commit f979aff468a4bdc32aad7b073583823cddf8f21c)

15 months agoAllow flat for join with name
Eric Atkin [Wed, 3 Jul 2024 20:05:04 +0000 (16:05 -0400)] 
Allow flat for join with name

The :paramref:`_orm.aliased.name` parameter to :func:`_orm.aliased` may now
be combined with the :paramref:`_orm.aliased.flat` parameter, producing
per-table names based on a name-prefixed naming convention.  Pull request
courtesy Eric Atkin.

Fixes: #11575
Closes: #11531
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11531
Pull-request-sha: f85535464be7b04d5f9745848d28f87dcd248b86

Change-Id: If79679c7a9598fffe99c033894b7dffecef13939
(cherry picked from commit 0e40962bf300bb26c873d00d80813a735fb7447f)

15 months agoMerge "handle DBAPI error for fetchall()" into rel_2_0
Michael Bayer [Thu, 4 Jul 2024 14:43:58 +0000 (14:43 +0000)] 
Merge "handle DBAPI error for fetchall()" into rel_2_0

15 months agoMerge "call iter() on detached/transient dynamic session" into rel_2_0
Michael Bayer [Wed, 3 Jul 2024 13:07:43 +0000 (13:07 +0000)] 
Merge "call iter() on detached/transient dynamic session" into rel_2_0

15 months agoBump pypa/cibuildwheel from 2.19.1 to 2.19.2 (#11561)
dependabot[bot] [Tue, 2 Jul 2024 20:18:06 +0000 (22:18 +0200)] 
Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 (#11561)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.1 to 2.19.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.19.1...v2.19.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 fb388a18fb45025150b2c64cdb2a08694d993c97)

15 months agoFix table reflection on oracle <10.2
Sergio Oller Moreno [Tue, 2 Jul 2024 08:39:00 +0000 (04:39 -0400)] 
Fix table reflection on oracle <10.2

Fixed table reflection on Oracle 10.2 and older where compression options
are not supported.

Fixes: #11557
Closes: #11558
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11558
Pull-request-sha: 44e4f51a3616388f39b0f5edee3124d389765da3

Change-Id: I34c6a367bef158a0c6cf01f185e18392552b7cc7
(cherry picked from commit e4aa3bedf83a0325f747eca187e623f48f036c9d)

15 months agocall iter() on detached/transient dynamic session
Mike Bayer [Tue, 2 Jul 2024 17:57:47 +0000 (13:57 -0400)] 
call iter() on detached/transient dynamic session

Fixed regression going back to 1.4 where accessing a collection using the
"dynamic" strategy on a transient object and attempting to query would
raise an internal error rather than the expected :class:`.NoResultFound`
that occurred in 1.3.

Fixes: #11562
Change-Id: I650305963a17592413520d8d1049c601761a0acc
(cherry picked from commit d9d98eacca11490b7df878ef399b92fbb2df2f47)

15 months agohandle DBAPI error for fetchall()
Mike Bayer [Fri, 28 Jun 2024 20:30:57 +0000 (16:30 -0400)] 
handle DBAPI error for fetchall()

Fixed issue in "insertmanyvalues" feature where a particular call to
``cursor.fetchall()`` were not wrapped in SQLAlchemy's exception wrapper,
which apparently can raise a database exception during fetch when using
pyodbc.

Fixes: #11532
Change-Id: Ic07d3e79dd597e18d87a56b45ddffa25e762beb9
(cherry picked from commit fb47dbbc74f59d0be3411d52bc27155095b50631)

15 months agoDocs: simplify language in getting a connection & committing changes
lonkeknol [Fri, 28 Jun 2024 16:27:33 +0000 (12:27 -0400)] 
Docs: simplify language in getting a connection & committing changes

### Description
Simplifies language use in [Getting a Connection](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#getting-a-connection) and [Committing Changes](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#committing-changes)

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

**Have a nice day!**

Closes: #11542
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11542
Pull-request-sha: d706e69fb6058d3483fce98cfacbbf36ca12d78e

Change-Id: I7788f2a16a5127b3c9623f7b00f06f649b04e0fb
(cherry picked from commit 82d14a7515187ad744037ca9017ced1782314854)

15 months agoMerge "Warn if an engine bind left an open transaction" into rel_2_0
Michael Bayer [Fri, 28 Jun 2024 16:29:34 +0000 (16:29 +0000)] 
Merge "Warn if an engine bind left an open transaction" into rel_2_0

15 months agocache key share; support correct traverse of 'of'
Mike Bayer [Thu, 27 Jun 2024 22:17:47 +0000 (18:17 -0400)] 
cache key share; support correct traverse of 'of'

Fixed caching issue where the
:paramref:`_sql.Select.with_for_update.key_share` element of
:meth:`_sql.Select.with_for_update` was not considered as part of the cache
key, leading to incorrect caching if different variations of this parameter
were used with an otherwise identical statement.

Also repairs a traversal issue where the ``of`` element of
``ForUpdateArg`` when set to ``None`` cannot be compared against a
non-None element because the traversal defines it as a clauselist.
Traversal in this case is adjusted to accommodate for this case so that
we dont need to create a risky-to-backport change to ``ForUpdateArg``
itself.

Fixes: #11544
Change-Id: Ie8a50716df06977af58b0c22a8c10e1b64d972b9
(cherry picked from commit 6d2f43e14f2fe25cdc811355b7bd6d11f8eee381)

15 months agoDocs: simplify language use for "Working with Transactions and the DBAPI"
lonkeknol [Thu, 27 Jun 2024 13:03:30 +0000 (09:03 -0400)] 
Docs: simplify language use for "Working with Transactions and the DBAPI"

### Description
This is my first pull request to sqlalchemy. It changes the writing style of two paragraphs in the unified tutorial [here](https://docs.sqlalchemy.org/en/20/tutorial/dbapi_transactions.html#working-with-transactions-and-the-dbapi). My goals were to.
1. Make them easier to read
2. Not change the meaning of the text.
3. Get feedback on whether this type of contribution is considered useful for sqlalchemy.

If this is a useful type of contribution, it might be good to discuss some general guidelines for me to adhere to as I continue. For instance:
- Prefer using present simple tense
- Remove superfluous words where possible
- Keep the pull requests to one or two h2 sections at a time, to make the review easier

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

I'm curious to hear what you all think. **Have a nice day!**

Closes: #11541
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11541
Pull-request-sha: 3179690e6a5b47de99a4486a7a15cffbfacd380b

Change-Id: I9b47f6ce4fd00c44c4b0e19957acf250f5e46d2f
(cherry picked from commit fc2cb4496d35c0b8bb7d59aa74b553f07210eded)

15 months agoadd additional test cases re: #11371
Mike Bayer [Wed, 26 Jun 2024 16:13:28 +0000 (12:13 -0400)] 
add additional test cases re: #11371

Just want to make sure aliased() and with_polymorphic() still
work in the of_type() context here, since that's likely why we
had Any for this parameter in the first place

Change-Id: I0a2c4445bc3b91039b3446d31b4a02db28feaee7
(cherry picked from commit 9b631dff45bbf4539c78eb73529b960acda80efd)

15 months agoMerge "set type of type_of to be same as input argument" into rel_2_0
Michael Bayer [Wed, 26 Jun 2024 16:10:25 +0000 (16:10 +0000)] 
Merge "set type of type_of to be same as input argument" into rel_2_0

15 months agoHandle "SSL SYSCALL error: Success" in psycopg2
David H. Irving [Sun, 23 Jun 2024 09:37:24 +0000 (05:37 -0400)] 
Handle "SSL SYSCALL error: Success" in psycopg2

Added "SSL SYSCALL error: Success" to the list of exceptions
that are considered a "disconnect" in psycopg2.

Fixes: #11522
Closes: #11523
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11523
Pull-request-sha: 63ad54e49dc3daa459caa29da8cffcb3e47a3f8c

Change-Id: I0db49d5c4db418a8e634f5370c76b99aaa3d3af6
(cherry picked from commit 03d2832fbfd053b6f58f0879e823920ca9d71cbb)

15 months agoset type of type_of to be same as input argument
Wouter Kayser [Sun, 23 Jun 2024 10:18:05 +0000 (06:18 -0400)] 
set type of type_of to be same as input argument

Fixes: #11371
Fixes the of_type method so that it does not return a class with unset generic.
See the original issue for a more detailed explanation.

Closes: #11416
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11416
Pull-request-sha: ed8d0edebb6b84b9dcffcf24c52f113c37e7fedd

Change-Id: I35637491d6d9c573825f6d13299712626dd521c5
(cherry picked from commit 7d8dfa10df3be8d138dd954708efca7d6ed0e503)

15 months agoWarn if an engine bind left an open transaction
Federico Caselli [Fri, 15 Mar 2024 18:15:27 +0000 (19:15 +0100)] 
Warn if an engine bind left an open transaction

Added a warning noting when an
:meth:`_engine.ConnectionEvents.engine_connect` event may be leaving
a transaction open, which can alter the behavior of a
class:`_orm.Session` using such an engine as bind.
On SQLAlchemy 2.1 :paramref:`_orm.Session.join_transaction_mode` will
instead be ignored in all cases when the session bind is
an :class:`_engine.Engine`.

Fixes: #11163
Change-Id: I10147876d07352f2dab898d615e98a9acd6eb91b
(cherry picked from commit 69a2d0903e427e99acceedcd4e29a17d0b012bbe)