]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
22 months agogeneralize pydantic version warning 10249/head
Sebastian Bayer [Thu, 17 Aug 2023 11:30:45 +0000 (13:30 +0200)] 
generalize pydantic version warning

Pydantic 1.x and 2.x both have compatibility issues with sqlalchemy, which we denote by removing the restriction on the 1.x version of pydantic

22 months agoVersion 2.0.21 placeholder
Mike Bayer [Tue, 15 Aug 2023 18:51:00 +0000 (14:51 -0400)] 
Version 2.0.21 placeholder

22 months ago- 2.0.20 rel_2_0_20
Mike Bayer [Tue, 15 Aug 2023 18:34:31 +0000 (14:34 -0400)] 
- 2.0.20

22 months agolimit drivers for memusage target
Mike Bayer [Tue, 15 Aug 2023 18:27:34 +0000 (14:27 -0400)] 
limit drivers for memusage target

apparently on CI the memusage target is running with the much
slower sqlite_numeric "fake" dialect.  limit this target to straight
sqlite and psycopg2

Change-Id: Ica66204cd5d612439f7d6ce53eff0965e97176b1

22 months agofix test case for SQL server
Mike Bayer [Tue, 15 Aug 2023 13:38:52 +0000 (09:38 -0400)] 
fix test case for SQL server

Change-Id: I607a825e8d2c5b27e7404239e1a6c1a5340532e7

23 months agoadd nullable construct to better type outer joins
Federico Caselli [Sat, 5 Aug 2023 13:07:26 +0000 (15:07 +0200)] 
add nullable construct to better type outer joins

Fixes: #10173
Change-Id: Ie203232de744882235f1543ec8c73c7d5fe99e3e

23 months agoMerge "propagate regular execution_options to secondary eager loaders" into main
mike bayer [Mon, 14 Aug 2023 22:35:10 +0000 (22:35 +0000)] 
Merge "propagate regular execution_options to secondary eager loaders" into main

23 months agopropagate regular execution_options to secondary eager loaders
Mike Bayer [Sun, 13 Aug 2023 15:16:03 +0000 (11:16 -0400)] 
propagate regular execution_options to secondary eager loaders

Fixed fairly major issue where execution options passed to
:meth:`_orm.Session.execute`, as well as execution options local to the ORM
executed statement itself, would not be propagated along to eager loaders
such as that of :func:`_orm.selectinload`, :func:`_orm.immediateload`, and
:meth:`_orm.subqueryload`, making it impossible to do things such as
disabling the cache for a single statement or using
``schema_translate_map`` for a single statement, as well as the use of
user-custom execution options.   A change has been made where **all**
user-facing execution options present for :meth:`_orm.Session.execute` will
be propagated along to additional loaders.

As part of this change, the warning for "excessively deep" eager loaders
leading to caching being disabled can be silenced on a per-statement
basis by sending ``execution_options={"compiled_cache": None}`` to
:meth:`_orm.Session.execute`, which will disable caching for the full
series of statements within that scope.

Fixes: #10231
Change-Id: I5304d3af0b78e1b4593c3558f117b7ac10b499ae

23 months agoupdate CI supported DB versions
Mike Bayer [Mon, 14 Aug 2023 18:20:12 +0000 (14:20 -0400)] 
update CI supported DB versions

Change-Id: I6f7991242eebc2b25df96e6779881882d29eb7a1

23 months agoMerge "restore slotscheck, skipping mypy extension" into main
mike bayer [Mon, 14 Aug 2023 14:37:33 +0000 (14:37 +0000)] 
Merge "restore slotscheck, skipping mypy extension" into main

23 months agodon't encourage "reader/writer" engines in one session
Mike Bayer [Mon, 14 Aug 2023 14:13:01 +0000 (10:13 -0400)] 
don't encourage "reader/writer" engines in one session

Change-Id: Ia18db210bf22d76147c80e901ac755442faa19be
References: #10233

23 months agorestore slotscheck, skipping mypy extension
Mike Bayer [Mon, 14 Aug 2023 13:46:47 +0000 (09:46 -0400)] 
restore slotscheck, skipping mypy extension

in [1] it was identified that import issues in the mypy extension
in interaction with mypy 1.5 is the source of the error in slotscheck.

I'm happy to remove mypy as a dependency for the slotscheck step
in any case.

[1] https://github.com/ariebovenberg/slotscheck/issues/178

Change-Id: I750de591179840a586650d303bcaf2ede59ec048

23 months agodisable slotscheck pending core dump issue
Mike Bayer [Sun, 13 Aug 2023 18:26:57 +0000 (14:26 -0400)] 
disable slotscheck pending core dump issue

Change-Id: I7083d0a9955caa28156e2ed183875b42dbada4c1
References: https://github.com/ariebovenberg/slotscheck/issues/178

23 months agosafe annotate QueryableAttribute inside of join() condition
Mike Bayer [Thu, 10 Aug 2023 22:26:45 +0000 (18:26 -0400)] 
safe annotate QueryableAttribute inside of join() condition

Fixed fundamental issue which prevented some forms of ORM "annotations"
from taking place for subqueries which made use of :meth:`_sql.Select.join`
against a relationship target.  These annotations are used whenever a
subquery is used in special situations such as within
:meth:`_orm.PropComparator.and_` and other ORM-specific scenarios.

Fixes: #10223
Change-Id: I40f04265a6caa0fdcbc9f1b121a35561ab4b1fcf

23 months agoupdate slotscheck
Mike Bayer [Fri, 11 Aug 2023 19:30:58 +0000 (15:30 -0400)] 
update slotscheck

we are getting intermittent crashes from slotscheck on CI.
actually I saw one just happen here with the latest version, it's
a core dump :(.  anyway, try it anyway see if things improve

Change-Id: I8c0a37df245e44dbffb4713e52ef27894843a720

23 months agoMerge "implement custom setstate to work around implicit type/comparator" into main
mike bayer [Thu, 10 Aug 2023 21:04:35 +0000 (21:04 +0000)] 
Merge "implement custom setstate to work around implicit type/comparator" into main

23 months agore-add aiomysql to the ci, remove unmaintained note
Federico Caselli [Sat, 5 Aug 2023 10:02:53 +0000 (12:02 +0200)] 
re-add aiomysql to the ci, remove unmaintained note

References: #6893
Change-Id: Ifb70975f686eef2b7239ca266e9dbfff1f1007cb

23 months agoimplement custom setstate to work around implicit type/comparator
Mike Bayer [Wed, 9 Aug 2023 14:17:35 +0000 (10:17 -0400)] 
implement custom setstate to work around implicit type/comparator

Fixed issue where unpickling of a :class:`_schema.Column` or other
:class:`_sql.ColumnElement` would fail to restore the correct "comparator"
object, which is used to generate SQL expressions specific to the type
object.

Fixes: #10213
Change-Id: I74e805024bcc0d93d549bd94757c2865b3117d72

23 months agoupdate for mypy 1.5
Mike Bayer [Thu, 10 Aug 2023 18:34:14 +0000 (14:34 -0400)] 
update for mypy 1.5

Change-Id: I70a210caa71d538c3c3baf56f25f218edaa6250d

23 months agoMerge "Fix type annotation of schema.MetaData.naming_convention" into main
mike bayer [Thu, 10 Aug 2023 15:34:49 +0000 (15:34 +0000)] 
Merge "Fix type annotation of schema.MetaData.naming_convention" into main

23 months agoMerge "Add where criteria example to selected_columns attribute" into main
mike bayer [Wed, 9 Aug 2023 23:38:27 +0000 (23:38 +0000)] 
Merge "Add where criteria example to selected_columns attribute" into main

23 months agoMerge "Fix annotations" into main
mike bayer [Wed, 9 Aug 2023 22:59:31 +0000 (22:59 +0000)] 
Merge "Fix annotations" into main

23 months agoAdd where criteria example to selected_columns attribute
Federico Caselli [Tue, 8 Aug 2023 19:41:29 +0000 (21:41 +0200)] 
Add where criteria example to selected_columns attribute

Change-Id: Ic9050dd846d5a3103aabe6c4d90e5bf2d7b8372d

23 months agoFix annotations
Mehdi Gmira [Mon, 7 Aug 2023 14:50:39 +0000 (10:50 -0400)] 
Fix annotations

Typing improvements:

* :class:`.CursorResult` is returned for some forms of
:meth:`_orm.Session.execute` where DML without RETURNING is used
* fixed type for :paramref:`_orm.Query.with_for_update.of` parameter within
:meth:`_orm.Query.with_for_update`
* improvements to ``_DMLColumnArgument`` type used by some DML methods to
pass column expressions
* Add overload to :func:`_sql.literal` so that it is inferred that the
return type is ``BindParameter[NullType]`` where
:paramref:`_sql.literal.type_` param is None
* Add overloads to :meth:`_sql.ColumnElement.op` so that the inferred
type when :paramref:`_sql.ColumnElement.op.return_type` is not provided
is ``Callable[[Any], BinaryExpression[Any]]``
* Add missing overload to :meth:`_sql.ColumnElement.__add__`

Pull request courtesy Mehdi Gmira.

Fixes: #9185
Closes: #10108
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10108
Pull-request-sha: 6017526c9cd1282025885cb002de1f984f64205b

Change-Id: I77a2a199b7a8b137b405001bef8813cf2d327bca

23 months agoFix type annotation of schema.MetaData.naming_convention
Federico Caselli [Mon, 7 Aug 2023 20:37:12 +0000 (22:37 +0200)] 
Fix type annotation of schema.MetaData.naming_convention

Fixed #9600
Closes: #9598
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9598
Pull-request-sha: d458e36242c60f44b1140697ae04cc8ad8ac5b98

Change-Id: I2290d1955c21f8d40765f78e486c739263f6e4ab

23 months agoMerge "Modernize Self-Referential example" into main
mike bayer [Tue, 8 Aug 2023 14:29:23 +0000 (14:29 +0000)] 
Merge "Modernize Self-Referential example" into main

23 months agoimplement RETURNING * for ORM DML
Mike Bayer [Mon, 7 Aug 2023 14:47:11 +0000 (10:47 -0400)] 
implement RETURNING * for ORM DML

Implemented the "RETURNING '*'" use case for ORM enabled DML statements.
This will render in as many cases as possible and return the unfiltered
result set, however is not supported for multi-parameter "ORM bulk INSERT"
statements that have specific column rendering requirements.

Fixes: #10192
Change-Id: I04297d08eacb9ad1d5fd6d9dd21afefb8e9dc0b1

23 months agoModernize Self-Referential example
Federico Caselli [Tue, 18 Jul 2023 18:18:47 +0000 (20:18 +0200)] 
Modernize Self-Referential example

References: #10115
Change-Id: Iee85b1277cdfee93ffb096df8ba85af48d09f1bc

23 months ago[docs] Typo: Update session_transaction.rst (#10185)
Gabriel Izoton [Fri, 4 Aug 2023 17:48:41 +0000 (14:48 -0300)] 
[docs] Typo: Update session_transaction.rst (#10185)

Fixed typo: `tranasction` -> `transaction`

23 months agoMerge "apply correct type to orm connection.execution_options" into main
mike bayer [Fri, 4 Aug 2023 14:59:06 +0000 (14:59 +0000)] 
Merge "apply correct type to orm connection.execution_options" into main

23 months agoapply correct type to orm connection.execution_options
Mike Bayer [Fri, 4 Aug 2023 00:14:39 +0000 (20:14 -0400)] 
apply correct type to orm connection.execution_options

Fixed issue in :class:`_orm.Session` and :class:`_asyncio.AsyncSession`
methods such as :meth:`_orm.Session.connection` where the
:paramref:`_orm.Session.connection.execution_options` parameter were
hardcoded to an internal type that is not user-facing.

Fixes: #10182
Change-Id: Iab9d510bf182c7dfc0521c948cf63396d05078e5

23 months agofix typo
Mike Bayer [Fri, 4 Aug 2023 14:01:07 +0000 (10:01 -0400)] 
fix typo

Change-Id: I55855508fdf7e0f0af346f4f1f79292d83784aea

23 months agoMerge "ensure collection adapter is serialized" into main
mike bayer [Thu, 3 Aug 2023 14:12:45 +0000 (14:12 +0000)] 
Merge "ensure collection adapter is serialized" into main

23 months agoupdate dogpile_caching examples
Mike Bayer [Thu, 3 Aug 2023 03:40:17 +0000 (23:40 -0400)] 
update dogpile_caching examples

Change-Id: I10e2b48afae01b65d61849841b528f1d275439ba

23 months agoensure collection adapter is serialized
Mike Bayer [Wed, 2 Aug 2023 17:34:03 +0000 (13:34 -0400)] 
ensure collection adapter is serialized

Fixed issue where dictionary-based collections such as
:func:`_orm.attribute_keyed_dict` did not fully pickle/unpickle correctly,
leading to issues when attempting to mutate such a collection after
unpickling.

Fixes: #10175
Change-Id: I1281f8695a0c95a20cab9449ee9c5d2db0d544fe

23 months agoMerge "`AsyncConnection[AsyncSession].aclose` implementation" into main
mike bayer [Tue, 1 Aug 2023 19:40:12 +0000 (19:40 +0000)] 
Merge "`AsyncConnection[AsyncSession].aclose` implementation" into main

23 months agoMerge "expand out all columns for _all_column_expressions" into main
mike bayer [Tue, 1 Aug 2023 18:35:43 +0000 (18:35 +0000)] 
Merge "expand out all columns for _all_column_expressions" into main

23 months agoexpand out all columns for _all_column_expressions
Mike Bayer [Mon, 31 Jul 2023 21:47:07 +0000 (17:47 -0400)] 
expand out all columns for _all_column_expressions

Fixed issue where the ORM's generation of a SELECT from a joined
inheritance model with same-named columns in superclass and subclass would
somehow not send the correct list of column names to the :class:`.CTE`
construct, when the RECURSIVE column list were generated.

Fixes: #10169
Change-Id: I531d9bb469443c077ee34cbc1eeb097ada46f20f

23 months ago`AsyncConnection[AsyncSession].aclose` implementation
semen603089 [Sat, 29 Jul 2023 03:09:20 +0000 (23:09 -0400)] 
`AsyncConnection[AsyncSession].aclose` implementation

Added new methods :meth:`_asyncio.AsyncConnection.aclose` as a synonym for
:meth:`_asyncio.AsyncConnection.close` and
:meth:`_asyncio.AsyncSession.aclose` as a synonym for
:meth:`_asyncio.AsyncSession.close` to the
:class:`_asyncio.AsyncConnection` and :class:`_asyncio.AsyncSession`
objects, to provide compatibility with Python standard library
``@contextlib.aclosing`` construct. Pull request courtesy Grigoriev Semyon.

Fixes: #9698
Closes: #10106
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10106
Pull-request-sha: 9dbe87324d496323f1da4a131b4c3d485a8eea1b

Change-Id: I861d1fd4586018c2bdd6b45d7918af4f7d48d193

23 months agopass along independent CTE attributes in ORM context
Mike Bayer [Mon, 31 Jul 2023 15:17:20 +0000 (11:17 -0400)] 
pass along independent CTE attributes in ORM context

Fixed issue where an ORM-enabled :func:`_sql.select` construct would not
render any CTEs added only via the :meth:`_sql.Select.add_cte` method that
were not otherwise referenced in the statement.

Fixes: #10167
Change-Id: Ib13f478607628b02742e6026e94bce54b089627d

23 months agoindicate pymssql as only binary
Mike Bayer [Mon, 31 Jul 2023 18:07:45 +0000 (14:07 -0400)] 
indicate pymssql as only binary

a new release of pymssql is out and they don't have wheel files,
so builds are failing.

we don't have deps set up to build pymssql, so hack into tox.ini
to force pip to only use a wheel.

additionally, add "py3" as a recognized target where we are referring
to specific py3 versions.

Change-Id: Id876fe902d4d7cae964a241c9fd7b678645b0ea5

23 months agoMerge "implement join_depth for immediateload, fix expunged loading" into main
mike bayer [Sat, 29 Jul 2023 03:08:44 +0000 (03:08 +0000)] 
Merge "implement join_depth for immediateload, fix expunged loading" into main

23 months agodont rely on default_isolation_level to restore engine-level iso
Mike Bayer [Wed, 26 Jul 2023 16:10:48 +0000 (12:10 -0400)] 
dont rely on default_isolation_level to restore engine-level iso

Fixed critical issue where setting
:paramref:`_sa.create_engine.isolation_level` to ``AUTOCOMMIT`` (as opposed
to using the :meth:`_engine.Engine.execution_options` method) would fail to
restore "autocommit" to a pooled connection if an alternate isolation level
were temporarily selected using
:paramref:`_engine.Connection.execution_options.isolation_level`.

Fixes: #10147
Change-Id: Ia22c15ab460cbbf8f6a731660874ace10df7c6a6

23 months agoimplement join_depth for immediateload, fix expunged loading
Mike Bayer [Tue, 25 Jul 2023 15:26:03 +0000 (11:26 -0400)] 
implement join_depth for immediateload, fix expunged loading

Fixed issue where the ``lazy="immediateload"`` loader strategy would place
an internal loading token into the ORM mapped attribute under circumstances
where the load should not occur, such as in a recursive self-referential
load.   As part of this change, the ``lazy="immediateload"`` strategy now
honors the :paramref:`_orm.relationship.join_depth` parameter for
self-referential eager loads in the same way as that of other eager
loaders, where leaving it unset or set at zero will lead to a
self-referential immediateload not occurring, setting it to a value of one
or greater will immediateload up until that given depth.

Fixes: #10139
Change-Id: I319d8cd86d7dd57f8ba61a9d483dc84505e02c72

23 months agoMerge "have token load flatten aliases unconditionally" into main
mike bayer [Tue, 25 Jul 2023 23:35:30 +0000 (23:35 +0000)] 
Merge "have token load flatten aliases unconditionally" into main

23 months agohave token load flatten aliases unconditionally
Mike Bayer [Thu, 20 Jul 2023 17:06:22 +0000 (13:06 -0400)] 
have token load flatten aliases unconditionally

Fixed issue where chaining :func:`_orm.load_only` or other wildcard use of
:func:`_orm.defer` from another eager loader using a :func:`_orm.aliased`
against a joined inheritance subclass would fail to take effect for columns
local to the superclass.

Fixes: #10125
Change-Id: I15e4b8be5a6d2ba49d2354fcd1daa099d8c3498f

23 months agode-clone FROM objects placed into from_linter.froms
Mike Bayer [Thu, 20 Jul 2023 16:36:35 +0000 (12:36 -0400)] 
de-clone FROM objects placed into from_linter.froms

Fixed issue where internal cloning used by the ORM for expressions like
:meth:`_orm.relationship.Comparator.any` to produce correlated EXISTS
constructs would interfere with the "cartesian product warning" feature of
the SQL compiler, leading the SQL compiler to warn when all elements of the
statement were correctly joined.

Fixes: #10124
Change-Id: I31c1ba538e2b943278e8cc0b7fddc107968a0826

23 months agoupdate callcount for cython 3
Mike Bayer [Wed, 19 Jul 2023 15:44:28 +0000 (11:44 -0400)] 
update callcount for cython 3

Change-Id: Iffe36d61e4872d0c59690aa837fd32f98fa4c403

23 months agoBump pypa/cibuildwheel from 2.14.0 to 2.14.1 (#10112)
dependabot[bot] [Mon, 17 Jul 2023 19:31:37 +0000 (21:31 +0200)] 
Bump pypa/cibuildwheel from 2.14.0 to 2.14.1 (#10112)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.14.0 to 2.14.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.14.0...v2.14.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>
23 months agoSwitch badge provider (#10067)
Jeff Widman [Sun, 16 Jul 2023 09:19:31 +0000 (02:19 -0700)] 
Switch badge provider (#10067)

Switch badge provider to point at Pepy.tech which provides further stats on the downloads.

Also they use a blue color which better matches the blue color of the other badges. 😁

2 years agoVersion 2.0.20 placeholder
Mike Bayer [Sat, 15 Jul 2023 13:07:05 +0000 (09:07 -0400)] 
Version 2.0.20 placeholder

2 years ago- 2.0.19 rel_2_0_19
Mike Bayer [Sat, 15 Jul 2023 12:55:40 +0000 (08:55 -0400)] 
- 2.0.19

2 years agoMerge "Rename Row t and tuples with underscored versions." into main
mike bayer [Fri, 14 Jul 2023 21:25:18 +0000 (21:25 +0000)] 
Merge "Rename Row t and tuples with underscored versions." into main

2 years agoRename Row t and tuples with underscored versions.
Federico Caselli [Wed, 12 Jul 2023 20:58:24 +0000 (22:58 +0200)] 
Rename Row t and tuples with underscored versions.

Renamed :attr:`_result.Row.t` and :meth:`_result.Row.tuple` to
:attr:`_result.Row._t` and :meth:`_result.Row._tuple`; this is to suit the
policy that all methods and pre-defined attributes on :class:`.Row` should
be in the style of Python standard library ``namedtuple`` where all fixed
names have a leading underscore, to avoid name conflicts with existing
column names.   The previous method/attribute is now deprecated and will
emit a deprecation warning.

Fixes: #10093
Change-Id: Ibb0e9423b55590c9dda8ee554187abd9a9122590

2 years agotest for None plugin_subject
Mike Bayer [Fri, 14 Jul 2023 16:08:24 +0000 (12:08 -0400)] 
test for None plugin_subject

Fixed additional regression caused by :ticket:`9805` where more aggressive
propagation of the "ORM" flag on statements could lead to an internal
attribute error when embedding an ORM :class:`.Query` construct that
nonetheless contained no ORM entities within a Core SQL statement, in this
case ORM-enabled UPDATE and DELETE statements.

Fixes: #10098
Change-Id: Ieeca9c64c28049e22d558ca47a720dd8bbe1eec9

2 years agochangelog updates
Mike Bayer [Wed, 12 Jul 2023 18:57:50 +0000 (14:57 -0400)] 
changelog updates

Change-Id: I087cf07afc4a665fc129c86118370b875aaa3238

2 years agoMerge "Fix url.make_url" into main
mike bayer [Wed, 12 Jul 2023 18:53:56 +0000 (18:53 +0000)] 
Merge "Fix url.make_url" into main

2 years agoMerge "Minor docs changes" into main
mike bayer [Wed, 12 Jul 2023 18:31:09 +0000 (18:31 +0000)] 
Merge "Minor docs changes" into main

2 years agoMerge "fix typing issue in main" into main
mike bayer [Wed, 12 Jul 2023 18:27:49 +0000 (18:27 +0000)] 
Merge "fix typing issue in main" into main

2 years agoMerge "ensure CITEXT is not cast as VARCHAR" into main
mike bayer [Wed, 12 Jul 2023 18:21:05 +0000 (18:21 +0000)] 
Merge "ensure CITEXT is not cast as VARCHAR" into main

2 years agoFix url.make_url
semen603089 [Wed, 12 Jul 2023 17:56:03 +0000 (13:56 -0400)] 
Fix url.make_url

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

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

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

-->

This pull request is:

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

Closes: #10080
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10080
Pull-request-sha: 133c7d6c35a75f23089fd4b1c0438f1a4640a924

Change-Id: Ie3d998385743680756bc10fbb4f4227669d57648

2 years agofix typing issue in main
Mike Bayer [Wed, 12 Jul 2023 17:50:39 +0000 (13:50 -0400)] 
fix typing issue in main

this is failing on 3.8

Change-Id: If348e88f938e8a239278ef14afbc2cb36a59b35d

2 years agoensure CITEXT is not cast as VARCHAR
Mike Bayer [Wed, 12 Jul 2023 13:32:10 +0000 (09:32 -0400)] 
ensure CITEXT is not cast as VARCHAR

Fixed issue where comparisons to the :class:`_postgresql.CITEXT` datatype
would cast the right side to ``VARCHAR``, leading to the right side not
being interpreted as a ``CITEXT`` datatype, for the asyncpg, psycopg3 and
pg80000 dialects.   This led to the :class:`_postgresql.CITEXT` type being
essentially unusable for practical use; this is now fixed and the test
suite has been corrected to properly assert that expressions are rendered
correctly.

Fixes: #10096
Change-Id: I49129e50261cf09942c0c339d581ce17a26d8181

2 years agoMerge "Improved typing" into main
mike bayer [Wed, 12 Jul 2023 14:24:37 +0000 (14:24 +0000)] 
Merge "Improved typing" into main

2 years agoMerge "cascade fixes revealed by the removal of cascade_backrefs" into main
mike bayer [Wed, 12 Jul 2023 00:43:23 +0000 (00:43 +0000)] 
Merge "cascade fixes revealed by the removal of cascade_backrefs" into main

2 years agoImproved typing
Federico Caselli [Fri, 23 Jun 2023 18:09:29 +0000 (20:09 +0200)] 
Improved typing

- correctly inspect orm classes and instances
- add missing generics in run_sync on async connection and session
- minor fixes to relationship order params and shift overload

Change-Id: I9aebd3e1312bca855c8451ec0cc02a891983063f

2 years agoMinor docs changes
Federico Caselli [Sat, 1 Jul 2023 10:07:24 +0000 (12:07 +0200)] 
Minor docs changes

Change-Id: I15d8aa3d497ef1f8bb1a14f216d99e4ebc5713b1

2 years agocascade fixes revealed by the removal of cascade_backrefs
Mike Bayer [Tue, 11 Jul 2023 13:58:22 +0000 (09:58 -0400)] 
cascade fixes revealed by the removal of cascade_backrefs

Fixed issue where setting a relationship collection directly, where an
object in the new collection were already present, would not trigger a
cascade event for that object, leading to it not being added to the
:class:`_orm.Session` if it were not already present.  This is similar in
nature to :ticket:`6471` and is a more apparent issue due to the removal of
``cascade_backrefs`` in the 2.0 series.  The
:meth:`_orm.AttributeEvents.append_wo_mutation` event added as part of
:ticket:`6471` is now also emitted for existing members of a collection
that are present in a bulk set of that same collection.

Fixed issue where objects that were associated with an unloaded collection
via backref, but were not merged into the :class:`_orm.Session` due to the
removal of ``cascade_backrefs`` in the 2.0 series, would not emit a warning
that these objects were not being included in a flush, even though they
were pending members of the collection; in other such cases, a warning is
emitted when a collection being flushed contains non-attached objects which
will be essentially discarded.  The addition of the warning for
backref-pending collection members establishes greater consistency with
collections that may be present or non-present and possibly flushed or not
flushed at different times based on different relationship loading
strategies.

Fixes: #10089
Fixes: #10090
Change-Id: I95610c17745f32141475cc6b4a4a5c6fc678fd05

2 years agorevert incorrectly merged change from a4e6e13d87c
Mike Bayer [Tue, 11 Jul 2023 15:25:15 +0000 (11:25 -0400)] 
revert incorrectly merged change from a4e6e13d87c

Change-Id: I3200482b0c0088534b17715f8cc6fdf37e879074

2 years agoBump pypa/cibuildwheel from 2.13.1 to 2.14.0 (#10086)
dependabot[bot] [Mon, 10 Jul 2023 20:44:38 +0000 (22:44 +0200)] 
Bump pypa/cibuildwheel from 2.13.1 to 2.14.0 (#10086)

Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.13.1 to 2.14.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.13.1...v2.14.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>
2 years agoAdd rockset-sqlalchemy to external dialects (#10087)
Aarav Borthakur [Mon, 10 Jul 2023 20:40:52 +0000 (13:40 -0700)] 
Add rockset-sqlalchemy to external dialects (#10087)

2 years agoadd a note to contains_eager re: propcomparator.and_
Mike Bayer [Mon, 10 Jul 2023 13:41:45 +0000 (09:41 -0400)] 
add a note to contains_eager re: propcomparator.and_

Change-Id: I5555db3a0e94a92a15759f64b6298c4b2800d183
References: https://github.com/sqlalchemy/sqlalchemy/discussions/9898#discussioncomment-6404539

2 years agoMerge "fix ConnectArgsType tuple to be variable length" into main
mike bayer [Sat, 8 Jul 2023 19:56:16 +0000 (19:56 +0000)] 
Merge "fix ConnectArgsType tuple to be variable length" into main

2 years agofix ConnectArgsType tuple to be variable length
Mike Bayer [Mon, 3 Jul 2023 16:12:01 +0000 (12:12 -0400)] 
fix ConnectArgsType tuple to be variable length

Fixes: #10038
Change-Id: I391aae0c553c4ebcdd1d09fd9fd445f839fb9906

2 years agoif only one host and/or port in query string, never raise
Mike Bayer [Fri, 7 Jul 2023 20:50:26 +0000 (16:50 -0400)] 
if only one host and/or port in query string, never raise

silently ignore the host portion of the URL if host=xyz
is present, and document this.

Fixes: #10076
Change-Id: I370b138aec63a9a2aa6029fe9e66eb1659434a43

2 years agoensure unix path syntax works for asyncpg as well
Mike Bayer [Thu, 6 Jul 2023 22:01:25 +0000 (18:01 -0400)] 
ensure unix path syntax works for asyncpg as well

update for a2c06a2a0acf769060f11bb34c1b55cecae5f5fe

updates test suite to include direct expected data / errors in
the test data

Fixes: #10069
Change-Id: I1e689101b90b7469608b74ed37abd7c2122151a4

2 years agoFix indentation in reST directive title (#10060)
Lele Gaifax [Thu, 6 Jul 2023 20:34:57 +0000 (22:34 +0200)] 
Fix indentation in reST directive title (#10060)

2 years agomatch on single host/port only for integer port
Mike Bayer [Thu, 6 Jul 2023 14:06:14 +0000 (10:06 -0400)] 
match on single host/port only for integer port

Fixed regression caused by improvements to PostgreSQL URL parsing in
:ticket:`10004` where "host" query string arguments that had colons in
them, to support various third party proxy servers and/or dialects, would
not parse correctly as these were evaluted as ``host:port`` combinations.
Parsing has been updated to consider a colon as indicating a ``host:port``
value only if the hostname contains only alphanumeric characters with dots
or dashes only (e.g. no slashes), followed by exactly one colon followed by
an all-integer token of zero or more integers.  In all other cases, the
full string is taken as a host.

Fixes: #10069
Change-Id: I77beb27e44abc0a66aa0810de855daa4186dacfd

2 years agoVersion 2.0.19 placeholder
Mike Bayer [Wed, 5 Jul 2023 19:00:42 +0000 (15:00 -0400)] 
Version 2.0.19 placeholder

2 years ago- 2.0.18 rel_2_0_18
Mike Bayer [Wed, 5 Jul 2023 18:47:58 +0000 (14:47 -0400)] 
- 2.0.18

2 years agoMerge "add option to disable INET, CIDR result set conversion" into main
mike bayer [Wed, 5 Jul 2023 18:45:37 +0000 (18:45 +0000)] 
Merge "add option to disable INET, CIDR result set conversion" into main

2 years agoadd option to disable INET, CIDR result set conversion
Mike Bayer [Mon, 3 Jul 2023 17:28:35 +0000 (13:28 -0400)] 
add option to disable INET, CIDR result set conversion

Added new parameter ``native_inet_types=False`` to the all PostgreSQL
dialects, which indicates the all converters used by the DBAPI to
convert rows from PostgreSQL :class:`.INET` and :class:`.CIDR` columns
into Python ``ipaddress`` datatypes should be disabled, returning strings
instead.  This allows code written to work with strings for these datatypes
to be migrated to asyncpg, psycopg, or pg8000 without code changes
beyond the engine parameter.

Currently, some DBAPIs return ``ipaddress`` objects while others return
strings for one or both of these datatypes.   A future release of
SQLAlchemy will attempt to normalize support for Python's ``ipaddress``
across all DBAPIs.

Fixes: #9945
Change-Id: Id59e9982e2bfd6706fe335e4e700902abfb63663

2 years agoMerge "Type annotate postgresql/sqlite/mysql insert" into main
mike bayer [Wed, 5 Jul 2023 18:11:34 +0000 (18:11 +0000)] 
Merge "Type annotate postgresql/sqlite/mysql insert" into main

2 years agochangelog updates
Mike Bayer [Wed, 5 Jul 2023 18:03:21 +0000 (14:03 -0400)] 
changelog updates

Change-Id: I77f8a7d4c593168346b5b5251478ceaca7f77c82

2 years agocherry-pick changelog update for 1.4.50
Mike Bayer [Wed, 5 Jul 2023 17:56:42 +0000 (13:56 -0400)] 
cherry-pick changelog update for 1.4.50

2 years agocherry-pick changelog from 1.4.49
Mike Bayer [Wed, 5 Jul 2023 17:56:40 +0000 (13:56 -0400)] 
cherry-pick changelog from 1.4.49

2 years agochangelog updates
Mike Bayer [Wed, 5 Jul 2023 17:37:25 +0000 (13:37 -0400)] 
changelog updates

Change-Id: If3baf79906d062e1e046d7c31b38eeeefdc984bf

2 years agoRevert "Fix type signature on create_connect_args"
Mike Bayer [Wed, 5 Jul 2023 17:23:20 +0000 (13:23 -0400)] 
Revert "Fix type signature on create_connect_args"

this was not supposed to be committed

This reverts commit 86078b8948e83e442c1bd4a7a501767ec775ec54.

2 years agoFix type signature on create_connect_args
Alex Rothberg [Thu, 29 Jun 2023 18:54:52 +0000 (14:54 -0400)] 
Fix type signature on create_connect_args
Fixes: #10038
2 years agoMerge "add tests for #10058" into main
mike bayer [Wed, 5 Jul 2023 17:07:27 +0000 (17:07 +0000)] 
Merge "add tests for #10058" into main

2 years agoupdate mypy warnings / deprecation
Mike Bayer [Wed, 5 Jul 2023 14:01:46 +0000 (10:01 -0400)] 
update mypy warnings / deprecation

Change-Id: I655e78feabcb94f02e82c81d3902aea9704a0fd3

2 years agoadd tests for #10058
Mike Bayer [Wed, 5 Jul 2023 13:47:34 +0000 (09:47 -0400)] 
add tests for #10058

Fixes: #10058
Change-Id: I1f551c1f8cd398bd7dc946e1b1c8963b06806e66

2 years agoMerge "allow aliased() to receive any FromClause" into main
mike bayer [Wed, 5 Jul 2023 12:24:08 +0000 (12:24 +0000)] 
Merge "allow aliased() to receive any FromClause" into main

2 years agoallow aliased() to receive any FromClause
Mike Bayer [Tue, 4 Jul 2023 18:13:31 +0000 (14:13 -0400)] 
allow aliased() to receive any FromClause

Fixed some of the typing within the :func:`_orm.aliased` construct to
correctly accept a :class:`.Table` object that's been aliased with
:meth:`.Table.alias`, as well as general support for :class:`.FromClause`
objects to be passed as the "selectable" argument, since this is all
supported.

Change-Id: I6dfd5c93dc2b2f23895fbd8982633f2ed13b5a52
References: #10061

2 years agoMerge "Add mssql_columnstore to index options." into main
mike bayer [Tue, 4 Jul 2023 01:26:52 +0000 (01:26 +0000)] 
Merge "Add mssql_columnstore to index options." into main

2 years agoMerge "support sql elements via standalone op functions" into main
mike bayer [Mon, 3 Jul 2023 20:09:05 +0000 (20:09 +0000)] 
Merge "support sql elements via standalone op functions" into main

2 years agosupport sql elements via standalone op functions
Mike Bayer [Mon, 3 Jul 2023 16:04:01 +0000 (12:04 -0400)] 
support sql elements via standalone op functions

Improved typing when using standalone operator functions from
``sqlalchemy.sql.operators`` such as ``sqlalchemy.sql.operators.eq``.

Fixes: #10054
Change-Id: I7e39cb3ccddb354a3f04f749ef65b18088e136e1

2 years agoMerge "remove use of SQL expressions in "modifiers" for regexp" into main
mike bayer [Mon, 3 Jul 2023 16:06:44 +0000 (16:06 +0000)] 
Merge "remove use of SQL expressions in "modifiers" for regexp" into main

2 years agoremove weird TOC thing from assocaition proxy
Mike Bayer [Mon, 3 Jul 2023 14:53:28 +0000 (10:53 -0400)] 
remove weird TOC thing from assocaition proxy

I have no idea where this came from but it highlights all
the sections

Change-Id: Ib9f81740f84e3b3077b84aeeda2ae0f1e8b832d2

2 years agofor python 3.12, use greenlet>=3.0.0a1
Mike Bayer [Sun, 2 Jul 2023 22:27:11 +0000 (18:27 -0400)] 
for python 3.12, use greenlet>=3.0.0a1

in the 1.4 backport at I91a51dcbad2902f7c4c7cec88ebbf42c2417b512 we
see that the newly released greenlet 3.0.0a1 installs / builds for
python 3.12.

Change-Id: Ib9e1aec8168996324dbb97c9cdbe1bc34bda7485