]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
4 years agoRemove pytest warning filter
Federico Caselli [Fri, 28 May 2021 19:18:51 +0000 (21:18 +0200)] 
Remove pytest warning filter

Change-Id: Ie18b66e4a8d59be12ee549347bd508036282c1c9

4 years agoVersion 1.4.17 placeholder
Mike Bayer [Fri, 28 May 2021 17:17:17 +0000 (13:17 -0400)] 
Version 1.4.17 placeholder

4 years ago- 1.4.16 rel_1_4_16
Mike Bayer [Fri, 28 May 2021 17:05:23 +0000 (13:05 -0400)] 
- 1.4.16

4 years agoMerge "Fix adaption in AnnotatedLabel; repair needless expense in coercion"
mike bayer [Fri, 28 May 2021 16:38:50 +0000 (16:38 +0000)] 
Merge "Fix adaption in AnnotatedLabel; repair needless expense in coercion"

4 years agoMerge "Test some complex update cases in the pg dialect"
mike bayer [Fri, 28 May 2021 14:57:40 +0000 (14:57 +0000)] 
Merge "Test some complex update cases in the pg dialect"

4 years agoMerge "Make other loop test compatible with py3.10"
mike bayer [Fri, 28 May 2021 14:57:18 +0000 (14:57 +0000)] 
Merge "Make other loop test compatible with py3.10"

4 years agoFix adaption in AnnotatedLabel; repair needless expense in coercion
Mike Bayer [Fri, 28 May 2021 12:29:24 +0000 (08:29 -0400)] 
Fix adaption in AnnotatedLabel; repair needless expense in coercion

Fixed regression involving clause adaption of labeled ORM compound
elements, such as single-table inheritance discriminator expressions with
conditionals or CASE expressions, which could cause aliased expressions
such as those used in ORM join / joinedload operations to not be adapted
correctly, such as referring to the wrong table in the ON clause in a join.

This change also improves a performance bump that was located within the
process of invoking :meth:`_sql.Select.join` given an ORM attribute
as a target.

Fixes: #6550
Change-Id: I98906476f0cce6f41ea00b77c789baa818e9d167

4 years agoensure relationship.order_by stored as a tuple; check in dynamic also
Mike Bayer [Fri, 28 May 2021 01:15:01 +0000 (21:15 -0400)] 
ensure relationship.order_by stored as a tuple; check in dynamic also

Fixed regression in dynamic loader strategy and :func:`_orm.relationship`
overall where the :paramref:`_orm.relationship.order_by` parameter were
stored as a mutable list, which could then be mutated when combined with
additional "order_by" methods used against the dynamic query object,
causing the ORDER BY criteria to continue to grow repetitively.

Fixes: #6549
Change-Id: I9f4c9a723aa0923f115cbe39bfaaa9cac62153b1

4 years agoMake other loop test compatible with py3.10
Federico Caselli [Thu, 27 May 2021 20:51:40 +0000 (22:51 +0200)] 
Make other loop test compatible with py3.10

Python 3.10 fixes the issue where the loop would bind to a queue
on instantiation. Now an object binds to the loop only when first
needs it. I've looked at queues, but I'm assuming locks behave
the same,

Change-Id: Ibb8d263cdea230e9c85709528c21da31d0df2e65

4 years agoAdd python 3.10 to github pipeline
Federico Caselli [Thu, 13 May 2021 19:59:12 +0000 (21:59 +0200)] 
Add python 3.10 to github pipeline

Change-Id: Iaa5c3ec2ad2bf70da412cc79871d22b7ea3bf9a6

4 years agoTest some complex update cases in the pg dialect
Federico Caselli [Tue, 25 May 2021 20:48:54 +0000 (22:48 +0200)] 
Test some complex update cases in the pg dialect

Change-Id: I2323e155e78aa8e1e00359b103974fb8d27d80eb

4 years agoget tests to pass on python 3.10
Mike Bayer [Wed, 26 May 2021 17:46:36 +0000 (13:46 -0400)] 
get tests to pass on python 3.10

Resolved various deprecation warnings which were appearing as of Python
version 3.10.0b1.

block aiomysql on python 3.10 as they are using the "loop" argument
that's removed

sqlcipher-binary has no builds on 3.10, block it for 3.10

Fixes: #6540
Fixes: #6543
Change-Id: Iec1e3881fb289878881ae043b1a18c3ecdf5f077

4 years agocx_oracle has changed main branch to "main"
Mike Bayer [Wed, 26 May 2021 16:55:41 +0000 (12:55 -0400)] 
cx_oracle has changed main branch to "main"

Change-Id: Idabb86665182af6c3d2cfb7b5c4ebd2cbc99c565

4 years agoremove outdated integrityerror example
Mike Bayer [Wed, 26 May 2021 16:13:30 +0000 (12:13 -0400)] 
remove outdated integrityerror example

Fixes: #5372
Change-Id: Ibf7c9969be543e38cd0c4773c413f085a57d94ab

4 years agoMerge "Removed automap deprecation warning"
Federico Caselli [Wed, 26 May 2021 06:07:50 +0000 (06:07 +0000)] 
Merge "Removed automap deprecation warning"

4 years agoRemoved automap deprecation warning
jason3gb [Tue, 25 May 2021 19:40:48 +0000 (15:40 -0400)] 
Removed automap deprecation warning

Fixed a deprecation warning that was emitted when using
:func:`_automap.automap_base` without passing an existing
``Base``.

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

### Description
Fixed the automap's declarative import from sqlalchemy.orm instead from the deprecated ext.declarative package

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

**Have a nice day!**

Closes: #6533
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6533
Pull-request-sha: 46d40005eae51fd7423da66f6ad4072f65744c1c

Change-Id: I432df70d4221873ca229076d5d3ac20b2870c13b

4 years agofix typo in"Connecting to databases with access tokens" (#6432)
Katsuyuki Sakai [Tue, 25 May 2021 19:51:53 +0000 (04:51 +0900)] 
fix typo in"Connecting to databases with access tokens" (#6432)

4 years agoFix minor glitches in the visitors.py docstrings (#6522)
Lele Gaifax [Tue, 25 May 2021 19:51:44 +0000 (21:51 +0200)] 
Fix minor glitches in the visitors.py docstrings (#6522)

* Fix docstring typo

* Capitalize first sentence word

* Properly markup class name

This is just for consistency with nearby references: the HasCacheKey class has no docstring so
it does not appear in the documentation, moreover it's in the traversals module, so Sphinx
cannot render it as a link anyway.

4 years agoAdd a template for use case
Mike Bayer [Tue, 25 May 2021 18:37:12 +0000 (14:37 -0400)] 
Add a template for use case

These are distinct from features.

Change-Id: I97caa25c94bdd71a3dd227614d03c3891cea5e87

4 years agoput bug guidelines in html comment
Mike Bayer [Tue, 25 May 2021 18:32:45 +0000 (14:32 -0400)] 
put bug guidelines in html comment

Change-Id: I3659b20f93a5059029176cc16c2ae4a3fde7c72e

4 years agoMerge "Provide primary key values for data in tests that aren't about primary keys."
mike bayer [Mon, 24 May 2021 18:17:11 +0000 (18:17 +0000)] 
Merge "Provide primary key values for data in tests that aren't about primary keys."

4 years agoMerge "URL parsing fixes"
mike bayer [Mon, 24 May 2021 18:16:01 +0000 (18:16 +0000)] 
Merge "URL parsing fixes"

4 years agoMerge "Add SSL connection info for psycopg2 and pg8000"
mike bayer [Mon, 24 May 2021 17:36:00 +0000 (17:36 +0000)] 
Merge "Add SSL connection info for psycopg2 and pg8000"

4 years agoProvide primary key values for data in tests that aren't about primary keys.
Jim Fulton [Tue, 18 May 2021 18:09:07 +0000 (14:09 -0400)] 
Provide primary key values for data in tests that aren't about primary keys.

(message written by Mike) some backends such as BigQuery have no
autoincrement mechanism at all.
while we would like to pursue a strategy where provisioning.py could
provide for an in-Python sequence generator, at least remove
the need for autoincrement in suite tests that don't need it.

Fixes: #6469
Closes: #6504
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6504
Pull-request-sha: c075014ef7de33e6eb3f389d24251ba184655e0b

Change-Id: I98e237a38417b68c87d0201717205d7655b1f44e

4 years agoURL parsing fixes
Mike Bayer [Mon, 24 May 2021 15:12:11 +0000 (11:12 -0400)] 
URL parsing fixes

Fixed a long-standing issue with :class:`.URL` where query parameters
following the question mark would not be parsed correctly if the URL did
not contain a database portion with a backslash.

Fixed issue where an ``@`` sign in the database portion of a URL would not
be interpreted correctly if the URL also had a username:password section.

Fixes: #6329
Fixes: #6482
Change-Id: I6cb6478affa49b618335b947a74e64090657a98c

4 years agoClarify close for sync / async session
Mike Bayer [Mon, 24 May 2021 13:59:17 +0000 (09:59 -0400)] 
Clarify close for sync / async session

Add seealso links from Session.close() and AsyncSession.close()
 to narrative description, clarify in both places what the method
does and does not do.

Change-Id: Ib804753a86b4761e5f198c52121e8433c851cbc4
References: #6528

4 years agoAdd SSL connection info for psycopg2 and pg8000
Gord Thompson [Sun, 23 May 2021 23:44:13 +0000 (17:44 -0600)] 
Add SSL connection info for psycopg2 and pg8000

Change-Id: I8ead04dd572f0c0020c226254543eb7d93876ee4

4 years agoMerge "Detect back_populates referring to non-relationship"
mike bayer [Fri, 21 May 2021 15:18:15 +0000 (15:18 +0000)] 
Merge "Detect back_populates referring to non-relationship"

4 years agoDetect back_populates referring to non-relationship
Federico Caselli [Wed, 12 May 2021 19:09:41 +0000 (21:09 +0200)] 
Detect back_populates referring to non-relationship

Change-Id: Ic26d5d6d230d8d3209e6e42ff7752b59b8cb7b28

4 years agoEnsure extended instrumentation is fully disposed
Mike Bayer [Thu, 20 May 2021 15:28:03 +0000 (11:28 -0400)] 
Ensure extended instrumentation is fully disposed

Fixed regression in the ``sqlalchemy.ext.instrumentation`` extension that
prevented instrumentation disposal from working completely. This fix
includes both a 1.4 regression fix as well as a fix for a related issue
that existed in 1.3 also.   As part of this change, the
:class:`sqlalchemy.ext.instrumentation.InstrumentationManager` class now
has a new method ``unregister()``, which replaces the previous method
``dispose()``, which was not called as of version 1.4.

Fixes: #6390
Change-Id: I1b7a0f190b56d31b93b5ba11f67dc9f73889958b

4 years agoMerge "Suggest ``literal_column`` instead of ``text`` for column elements"
mike bayer [Tue, 18 May 2021 12:37:00 +0000 (12:37 +0000)] 
Merge "Suggest ``literal_column`` instead of ``text`` for column elements"

4 years agoMerge "Remove pep484 type comments from the code"
mike bayer [Tue, 18 May 2021 02:15:26 +0000 (02:15 +0000)] 
Merge "Remove pep484 type comments from the code"

4 years agoSuggest ``literal_column`` instead of ``text`` for column elements
Federico Caselli [Thu, 22 Apr 2021 20:12:10 +0000 (22:12 +0200)] 
Suggest ``literal_column`` instead of ``text`` for column elements

the next section in the tutorial discusses literal_column()
already so this paragraph will just add some additional
encouragement to read on.

References: #6343
Change-Id: Iadaf84d80071e73eb2d0b7421a60e1790ecd0862

4 years agoMerge "docs: fix back_populates parameter reference"
mike bayer [Tue, 18 May 2021 02:04:27 +0000 (02:04 +0000)] 
Merge "docs: fix back_populates parameter reference"

4 years agoMerge "Use type_ when creating literals in _LiteralRoundTripFixture"
mike bayer [Tue, 18 May 2021 02:03:39 +0000 (02:03 +0000)] 
Merge "Use type_ when creating literals in _LiteralRoundTripFixture"

4 years agoRun SelectState from obj normalize ahead of calcing ORM joins
Mike Bayer [Mon, 17 May 2021 15:20:10 +0000 (11:20 -0400)] 
Run SelectState from obj normalize ahead of calcing ORM joins

Fixed regression where the full combination of joined inheritance, global
with_polymorphic, self-referential relationship and joined loading would
fail to be able to produce a query with the scope of lazy loads and object
refresh operations that also attempted to render the joined loader.

Fixes: #6495
Change-Id: If74a744c237069e3a89617498096c18b9b6e5dde

4 years agoUse type_ when creating literals in _LiteralRoundTripFixture
Jim Fulton [Mon, 17 May 2021 15:29:54 +0000 (11:29 -0400)] 
Use type_ when creating literals in _LiteralRoundTripFixture

Fixes #6496 by passing the `type_` argument passed to `run` to `literal`.

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.

**Have a nice day!**

Closes: #6497
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6497
Pull-request-sha: 5f82408b2c25c7593f7202533dde4e29f045de5d

Change-Id: Ieed822c157f91d95fe3a07ea4482a36777539c35

4 years agoadd missing config.yml from previous commit
Mike Bayer [Sun, 16 May 2021 16:47:40 +0000 (12:47 -0400)] 
add missing config.yml from previous commit

Change-Id: Ia23ca00c548bde416ee8282d470dd835f6d07f45

4 years agorework issue template
Mike Bayer [Sun, 16 May 2021 16:45:59 +0000 (12:45 -0400)] 
rework issue template

only bug reports are encouraged through "issues"

all other questions / features go through discussions

links to external help resources

Change-Id: I6ac2dc460a3bf9fbdaf63c1269e9ba7a5501f181

4 years agoRemove pep484 type comments from the code
Federico Caselli [Thu, 13 May 2021 19:20:51 +0000 (21:20 +0200)] 
Remove pep484 type comments from the code

Current effort is around the stub package, and having typing in
two places makes thing worse, since the types here are usually
outdated compared to the version in the stubs.

Once v2 gets under way we can start consolidating the types
here.

Fixes: #6461
Change-Id: I7132a444bd7138123074bf5bc664b4bb119a85ce

4 years agoConsult plugin_subject for non-ORM enabled stmts in get_bind()
Mike Bayer [Fri, 14 May 2021 14:29:55 +0000 (10:29 -0400)] 
Consult plugin_subject for non-ORM enabled stmts in get_bind()

Enhanced the bind resolution rules for :meth:`_orm.Session.execute` so that
when a non-ORM statement such as an :func:`_sql.insert` construct
nonetheless is built against ORM objects, to the greatest degree possible
the ORM entity will be used to resolve the bind, such as for a
:class:`_orm.Session` that has a bind map set up on a common superclass
without specific mappers or tables named in the map.

Fixes: #6484
Change-Id: Iaa711b7f2c7451377b50af63029f37c4375a6f7e

4 years agoreformat URL attributes
Mike Bayer [Wed, 12 May 2021 22:13:06 +0000 (18:13 -0400)] 
reformat URL attributes

these were using :var: which seems to not work now,
not sure if this broke due to sphinx 1.4 or if this was
broken anyway, but these are not even refs that can be picked
up by zzzeeksphinx now.

Change-Id: I24ae968ae5d870ec949b2b07dbad2afa6969a189

4 years agoFix documentation type in URL class
Federico Caselli [Wed, 12 May 2021 21:59:09 +0000 (23:59 +0200)] 
Fix documentation type in URL class

Change-Id: I16a24718ee322efeffbf5a268d995ff53c23b696

4 years agoUpdate black flak8 and zimports
Federico Caselli [Wed, 12 May 2021 20:01:45 +0000 (22:01 +0200)] 
Update black flak8 and zimports

Change-Id: I488c9557eda390e4a88319affd4c8813ee274f80

4 years agoCreate new event for collection add w/o mutation
Mike Bayer [Wed, 12 May 2021 13:26:03 +0000 (09:26 -0400)] 
Create new event for collection add w/o mutation

Fixed issue when using :paramref:`_orm.relationship.cascade_backrefs`
parameter set to ``False``, which per :ref:`change_5150` is set to become
the standard behavior in SQLAlchemy 2.0, where adding the item to a
collection that uniquifies, such as ``set`` or ``dict`` would fail to fire
a cascade event if the object were already associated in that collection
via the backref. This fix represents a fundamental change in the collection
mechanics by introducing a new event state which can fire off for a
collection mutation even if there is no net change on the collection; the
action is now suited using a new event hook
:meth:`_orm.AttributeEvents.append_wo_mutation`.

Fixes: #6471
Change-Id: Ic50413f7e62440dad33ab84838098ea62ff4e815

4 years agoMerge "allow CTE to be direct DML target"
mike bayer [Tue, 11 May 2021 18:09:36 +0000 (18:09 +0000)] 
Merge "allow CTE to be direct DML target"

4 years agoallow CTE to be direct DML target
Mike Bayer [Tue, 11 May 2021 12:39:24 +0000 (08:39 -0400)] 
allow CTE to be direct DML target

Implemented support for a :class:`_sql.CTE` construct to be used directly
as the target of a :func:`_sql.delete` construct, i.e. "WITH ... AS cte
DELETE FROM cte". This appears to be a useful feature of SQL Server.

The CTE is now generally usable as a DML target table however
it's not clear if this syntax is valid beyond the use case of
DELETE itself.

Fixes: #6464
Change-Id: I3aac6fae2a1abb39bc0ffa87a044f5eb4f90f026

4 years agoVersion 1.4.16 placeholder
Mike Bayer [Tue, 11 May 2021 04:38:50 +0000 (00:38 -0400)] 
Version 1.4.16 placeholder

4 years ago- 1.4.15 rel_1_4_15
Mike Bayer [Tue, 11 May 2021 04:26:13 +0000 (00:26 -0400)] 
- 1.4.15

4 years agoMerge "set bindparam.expanding in coercion again"
mike bayer [Tue, 11 May 2021 04:21:03 +0000 (04:21 +0000)] 
Merge "set bindparam.expanding in coercion again"

4 years agoset bindparam.expanding in coercion again
Mike Bayer [Tue, 11 May 2021 02:52:49 +0000 (22:52 -0400)] 
set bindparam.expanding in coercion again

Adjusted the logic added as part of :ticket:`6397` in 1.4.12 so that
internal mutation of the :class:`.BindParameter` object occurs within the
clause construction phase as it did before, rather than in the compilation
phase. In the latter case, the mutation still produced side effects against
the incoming construct and additionally could potentially interfere with
other internal mutation routines.

In order to solve the issue of the correct operator being present
on the BindParameter.expand_op, we necessarily have to expand the
BinaryExpression._negate() routine to flip the operator on the
BindParameter also.

Fixes: #6460
Change-Id: I1e53a9aeee4de4fc11af51d7593431532731561b

4 years agoImprove cascade backrefs warning and add `code` to deprecation warnings
Stephen Rosen [Fri, 7 May 2021 19:45:47 +0000 (15:45 -0400)] 
Improve cascade backrefs warning and add `code` to deprecation warnings

This adds a new description to errors.rst and adds support
for any SQLAlchemy warning to refer to an errors.rst code.

Fixes: #6148
Closes: #6250
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6250
Pull-request-sha: dbcaeb54e31517fe88f6f8c515f1024002675f13

Change-Id: I4303c62ac9b1f13f67a34f825687014f1771c98c

4 years agoMerge "Correct cache key for proxy_owner, with_context_options"
mike bayer [Mon, 10 May 2021 20:04:20 +0000 (20:04 +0000)] 
Merge "Correct cache key for proxy_owner, with_context_options"

4 years agoMerge "calculate warnings stacklevels dynamically"
mike bayer [Mon, 10 May 2021 20:01:01 +0000 (20:01 +0000)] 
Merge "calculate warnings stacklevels dynamically"

4 years agocalculate warnings stacklevels dynamically
Mike Bayer [Fri, 7 May 2021 17:01:40 +0000 (13:01 -0400)] 
calculate warnings stacklevels dynamically

A new approach has been applied to the warnings system in SQLAlchemy to
accurately predict the appropriate stack level for each warning
dynamically. This allows evaluating the source of SQLAlchemy-generated
warnings and deprecation warnings to be more straightforward as the warning
will indicate the source line within end-user code, rather than from an
arbitrary level within SQLAlchemy's own source code.

Fixes: #6241
Change-Id: I9ecf3b3ea77424d15e8d4c0aa47350602c0568d7

4 years agoCorrect cache key for proxy_owner, with_context_options
Mike Bayer [Mon, 10 May 2021 17:19:14 +0000 (13:19 -0400)] 
Correct cache key for proxy_owner, with_context_options

Fixed issue in subquery loader strategy which prevented caching from
working correctly. This would have been seen in the logs as a "generated"
message instead of "cached" for all subqueryload SQL emitted, which by
saturating the cache with new keys would degrade overall performance; it
also would produce "LRU size alert" warnings.

In this issue we also observe that the local LRU cache for lazyloader
and selectinloader will get used for all subsequent loads as well,
which makes it more likely to hit the limit of 30.   However rather than
trying to work this out, it would be better if we removed the
loader-local LRU caches altogether once we are confident these
are working well.

Fixes: #6459
Change-Id: Id953e8f75536bb87f7e3315929cebcd8f84a5a50

4 years agoreset session on new #6449 test for pypy
Mike Bayer [Sun, 9 May 2021 16:42:19 +0000 (12:42 -0400)] 
reset session on new #6449 test for pypy

Change-Id: If1c8c755a7e9c0191c1666a13b9e920effbeb5bc

4 years agoformatting
Mike Bayer [Sun, 9 May 2021 16:14:42 +0000 (12:14 -0400)] 
formatting

Change-Id: I69092dc6c2121bb780aed1b145ccd3eaabb0ff5d

4 years agoMerge "Update SQLAlchemy README.unittests.rst"
mike bayer [Sun, 9 May 2021 16:08:34 +0000 (16:08 +0000)] 
Merge "Update SQLAlchemy README.unittests.rst"

4 years agoremove extra verbiage
Mike Bayer [Sun, 9 May 2021 15:54:15 +0000 (11:54 -0400)] 
remove extra verbiage

having all this verbiage in the template itself means
all the issues will have all this verbiage in them, so
pull it back again.  there is unfortunately no way to
cleanly direct reporters through the guidelines with github.

Change-Id: I9835e412fac244b639d1fe6970e4dab43ab95117

4 years agofix quote.
Mike Bayer [Sun, 9 May 2021 15:52:04 +0000 (11:52 -0400)] 
fix quote.

I really wish there were a way to get the guidelines to be
HTML formatted.

Change-Id: I22de6d40be9940e152c829a7c9a1cfc0eaf2211c

4 years agotrying a different issue template
Mike Bayer [Sun, 9 May 2021 15:19:38 +0000 (11:19 -0400)] 
trying a different issue template

Change-Id: Ibb4fda98f4fdef569ce0bb9435849f0009ff1a82

4 years agoUpdate SQLAlchemy README.unittests.rst
Gord Thompson [Sun, 9 May 2021 13:41:32 +0000 (07:41 -0600)] 
Update SQLAlchemy README.unittests.rst

Change-Id: Ic7af61e68a0828401fb6774f9f301d83fad95367

4 years agoMerge "Ensure propagate_to_loaders honored at the sub-loader level"
mike bayer [Sun, 9 May 2021 02:59:21 +0000 (02:59 +0000)] 
Merge "Ensure propagate_to_loaders honored at the sub-loader level"

4 years agoEnsure propagate_to_loaders honored at the sub-loader level
Mike Bayer [Sun, 9 May 2021 01:21:35 +0000 (21:21 -0400)] 
Ensure propagate_to_loaders honored at the sub-loader level

Fixed additional regression caused by "eager loaders run on unexpire"
feature :ticket:`1763` where the feature would run for a
``contains_eager()`` eagerload option in the case that the
``contains_eager()`` were chained to an additional eager loader option,
which would then produce an incorrect query as the original query-bound
join criteria were no longer present.

The contains_eager() option correctly included
propagate_to_loaders=False however this would not be considered
if the contains_eager() were chained and therefore bundled inside
of an enclosing loader.  We don't want to turn off propagation
completely in that case because we still want the other
loaders inside to be handled individually, so add a check
as each option is moved into the query context.

Fixes: #6449
Change-Id: Icd1d6611095c20ae44ff5d2df734c24770fc8812

4 years agoadd ssl_check_hostname option in mysqldb
Jerry Zhao [Fri, 23 Apr 2021 15:54:04 +0000 (11:54 -0400)] 
add ssl_check_hostname option in mysqldb

Added support for the ``ssl_check_hostname=`` parameter in mysql connection
URIs and updated the mysql dialect documentation regarding secure
connections. Original pull request courtesy of Jerry Zhao.

Fixes: #5397
Closes: #5759
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5759
Pull-request-sha: 75f4bdc68d4b5745c518472e8bc2b02cec0f81e6

Change-Id: I964bfa7a4c15e215a3ad6e2b907cb78f5b3e5036

4 years agoVersion 1.4.15 placeholder
Mike Bayer [Thu, 6 May 2021 21:24:52 +0000 (17:24 -0400)] 
Version 1.4.15 placeholder

4 years ago- 1.4.14 rel_1_4_14
Mike Bayer [Thu, 6 May 2021 21:15:56 +0000 (17:15 -0400)] 
- 1.4.14

4 years agofix absolute import
Mike Bayer [Thu, 6 May 2021 21:13:53 +0000 (17:13 -0400)] 
fix absolute import

Change-Id: I57e7bb8ac8f53c601b2ec5462d7502f8e53f1b0f

4 years agoMerge "don't cache TypeDecorator by default"
mike bayer [Thu, 6 May 2021 21:12:48 +0000 (21:12 +0000)] 
Merge "don't cache TypeDecorator by default"

4 years agoMerge "mypy: fix working directory for mypy_extra_test_paths."
mike bayer [Thu, 6 May 2021 19:56:10 +0000 (19:56 +0000)] 
Merge "mypy: fix working directory for mypy_extra_test_paths."

4 years agodon't cache TypeDecorator by default
Mike Bayer [Thu, 6 May 2021 16:24:00 +0000 (12:24 -0400)] 
don't cache TypeDecorator by default

The :class:`.TypeDecorator` class will now emit a warning when used in SQL
compilation with caching unless the ``.cache_ok`` flag is set to ``True``
or ``False``. ``.cache_ok`` indicates that all the parameters passed to the
object are safe to be used as a cache key, ``False`` means they are not.

Fixes: #6436
Change-Id: Ib1bb7dc4b124e38521d615c2e2e691e4915594fb

4 years agoMerge "unify transactional context managers"
mike bayer [Thu, 6 May 2021 14:11:04 +0000 (14:11 +0000)] 
Merge "unify transactional context managers"

4 years agodocs: fix back_populates parameter reference
Maico Timmerman [Thu, 6 May 2021 13:57:09 +0000 (15:57 +0200)] 
docs: fix back_populates parameter reference

Fixes reference to relationship.back_populates in errors.rst.

Change-Id: I60ac97d5adcf453aa8363266210ceda4688baa6d

4 years agounify transactional context managers
Mike Bayer [Sun, 2 May 2021 22:31:03 +0000 (18:31 -0400)] 
unify transactional context managers

Applied consistent behavior to the use case of
calling ``.commit()`` or ``.rollback()`` inside of an existing
``.begin()`` context manager, with the addition of potentially
emitting SQL within the block subsequent to the commit or rollback.
This change continues upon the change first added in
:ticket:`6155` where the use case of calling "rollback" inside of
a ``.begin()`` contextmanager block was proposed:

* calling ``.commit()`` or ``.rollback()`` will now be allowed
without error or warning within all scopes, including
that of legacy and future :class:`_engine.Engine`, ORM
:class:`_orm.Session`, asyncio :class:`.AsyncEngine`.  Previously,
the :class:`_orm.Session` disallowed this.

* The remaining scope of the context manager is then closed;
when the block ends, a check is emitted to see if the transaction
was already ended, and if so the block returns without action.

* It will now raise **an error** if subsequent SQL of any kind
is emitted within the block, **after** ``.commit()`` or
``.rollback()`` is called.   The block should be closed as
the state of the executable object would otherwise be undefined
in this state.

Fixes: #6288
Change-Id: I8b21766ae430f0fa1ac5ef689f4c0fb19fc84336

4 years agoAdd a comment in the compiler on why the NOT IN operator
Federico Caselli [Wed, 5 May 2021 20:06:19 +0000 (22:06 +0200)] 
Add a comment in the compiler on why the NOT IN operator
is rendered using brackets.

Change-Id: I39c2e6a03e8aad7ff27bc6000da5bc9f1de14dc2

4 years agomypy: fix working directory for mypy_extra_test_paths.
Maico Timmerman [Wed, 5 May 2021 18:20:18 +0000 (20:20 +0200)] 
mypy: fix working directory for mypy_extra_test_paths.

Change-Id: I55f6b414dd6893590231cc929648db90d3ee4161

4 years agoMerge "Parenthesize for empty not in"
mike bayer [Wed, 5 May 2021 16:36:08 +0000 (16:36 +0000)] 
Merge "Parenthesize for empty not in"

4 years agoUpdate README.dialects.rst
Gord Thompson [Wed, 5 May 2021 00:07:43 +0000 (18:07 -0600)] 
Update README.dialects.rst

Update link to sqlalchemy-access, plus a few minor tweaks

Change-Id: Ief2876760edf4f7cec311748012cb0944df3babd

4 years agoMerge "Establish deprecation path for CursorResult.keys()"
mike bayer [Wed, 5 May 2021 14:05:11 +0000 (14:05 +0000)] 
Merge "Establish deprecation path for CursorResult.keys()"

4 years agoMerge "mypy: load extra test files from environment variable"
mike bayer [Wed, 5 May 2021 14:04:08 +0000 (14:04 +0000)] 
Merge "mypy: load extra test files from environment variable"

4 years agoParenthesize for empty not in
Mike Bayer [Wed, 5 May 2021 12:38:54 +0000 (08:38 -0400)] 
Parenthesize for empty not in

Fixed regression caused by the "empty in" change just made in
:ticket:`6397` 1.4.12 where the expression needs to be parenthesized for
the "not in" use case, otherwise the condition will interfere with the
other filtering criteria.

also amends StrSQLCompiler to use the newer "empty IN" style for
its compilation process.

Fixes: #6428
Change-Id: I182a552fc0d3065a9e38c0f4ece2deb143735c36

4 years agomypy: load extra test files from environment variable
Maico Timmerman [Fri, 30 Apr 2021 14:36:23 +0000 (16:36 +0200)] 
mypy: load extra test files from environment variable

Add --mypy-extra-test-path parameter to pytest execution to list extra
directories to load test files from.
This enables the stubs repo to load this plugin and specify it's
own test directory to run mypy tests. Supports both single file tests
and incremental tests based on patch files.

Change-Id: Id6424ff15b2f527183b9713384df3d625a8e6eb8

4 years agoUse sqlalchemyorg action forks for the releases.
Federico Caselli [Tue, 4 May 2021 20:14:35 +0000 (22:14 +0200)] 
Use sqlalchemyorg action forks for the releases.

Change-Id: Ib7ccde2fbcaefe80859941e5e46bebf4fe4ea689

4 years agoEstablish deprecation path for CursorResult.keys()
Mike Bayer [Tue, 4 May 2021 17:31:51 +0000 (13:31 -0400)] 
Establish deprecation path for CursorResult.keys()

Established a deprecation path for calling upon the
:meth:`_cursor.CursorResult.keys` method for a statement that returns no
rows to provide support for legacy patterns used by the "records" package
as well as any other non-migrated applications. Previously, this would
raise :class:`.ResourceClosedException` unconditionally in the same way as
it does when attempting to fetch rows. While this is the correct behavior
going forward, the :class:`_cursor.LegacyCursorResult` object will now in
this case return an empty list for ``.keys()`` as it did in 1.3, while also
emitting a 2.0 deprecation warning. The :class:`_cursor.CursorResult`, used
when using a 2.0-style "future" engine, will continue to raise as it does
now.

Fixes: #6427
Change-Id: I4148f28c88039e4141deeab28b1a5994e6d6e098

4 years agoRestore detached object logic for dynamic, but warn
Mike Bayer [Tue, 4 May 2021 15:19:00 +0000 (11:19 -0400)] 
Restore detached object logic for dynamic, but warn

Fixed regression involving ``lazy='dynamic'`` loader in conjunction with a
detached object. The previous behavior was that the dynamic loader upon
calling methods like ``.all()`` returns empty lists for detached objects
without error, this has been restored; however a warning is now emitted as
this is not the correct result. Other dynamic loader scenarios correctly
raise ``DetachedInstanceError``.

Fixes: #6426
Change-Id: Id7ad204bef947491fa7e462c5acda2055fada910

4 years agoVersion 1.4.14 placeholder
Mike Bayer [Mon, 3 May 2021 19:32:53 +0000 (15:32 -0400)] 
Version 1.4.14 placeholder

4 years ago- 1.4.13 rel_1_4_13
Mike Bayer [Mon, 3 May 2021 19:25:21 +0000 (15:25 -0400)] 
- 1.4.13

4 years agochangelog updates
Mike Bayer [Mon, 3 May 2021 19:24:48 +0000 (15:24 -0400)] 
changelog updates

Change-Id: Ieee55faa002cc25b3009f643e1c992180de92292

4 years agoloader strategy regression fixes
Mike Bayer [Mon, 3 May 2021 13:55:12 +0000 (09:55 -0400)] 
loader strategy regression fixes

Fixed regression where using :func:`_orm.selectinload` and
:func:`_orm.subqueryload` to load a two-level-deep path would lead to an
attribute error.

Fixed regression where using the :func:`_orm.noload` loader strategy in
conjunction with a "dynamic" relationship would lead to an attribute error
as the noload strategy would attempt to apply itself to the dynamic loader.

Fixes: #6419
Fixes: #6420
Change-Id: I933b208f16a9723f6ebeab7addbe118903a1f8f5

4 years agorestore legacy begin_nested()->root transaction behavior
Mike Bayer [Sun, 2 May 2021 14:19:16 +0000 (10:19 -0400)] 
restore legacy begin_nested()->root transaction behavior

Restored a legacy transactional behavior that was inadvertently removed
from the :class:`_engine.Connection` as it was never tested as a known use
case in previous versions, where calling upon the
:meth:`_engine.Connection.begin_nested` method, when no transaction were
present, would not create a SAVEPOINT at all, and would instead only start
the outermost transaction alone, and return that :class:`.RootTransaction`
object, acting like the outermost transaction.   Committing the transaction
object returned by :meth:`_engine.Connection.begin_nested` would therefore
emit a real COMMIT on the database connection.

This behavior is not at all what the 2.0 style connection will do - in 2.0
style, calling :meth:`_future.Connection.begin_nested` will "autobegin" the
outer transaction, and then as instructed emit a SAVEPOINT, returning the
:class:`.NestedTransaction` object. The outer transaction is committed by
calling upon :meth:`_future.Connection.commit`, as is "commit-as-you-go"
style usage.

In non-"future" mode, while the old behavior is restored, it also
emits a 2.0 deprecation warning as this is a legacy behavior.

Additionally clarifies and reformats various engine-related
documentation, in particular future connection.begin() which
was a tire fire.

Fixes: #6408
Change-Id: I4b81cc6b481b5493eef4c91bebc03210e2206d39

4 years agofix formatting
Mike Bayer [Sun, 2 May 2021 13:18:04 +0000 (09:18 -0400)] 
fix formatting

Change-Id: Id9026521d878baa2b2fc96159384135c27344def

4 years agoMerge "Support stream_results in the pg8000 dialect"
mike bayer [Sun, 2 May 2021 13:17:00 +0000 (13:17 +0000)] 
Merge "Support stream_results in the pg8000 dialect"

4 years agoMerge "Support filter_by() from columns, functions, Core SQL"
mike bayer [Sun, 2 May 2021 13:13:42 +0000 (13:13 +0000)] 
Merge "Support filter_by() from columns, functions, Core SQL"

4 years agospecify tuple_in for composite selectinload test / mssql
Mike Bayer [Sat, 1 May 2021 18:59:39 +0000 (14:59 -0400)] 
specify tuple_in for composite selectinload test / mssql

Change-Id: Ie527c4aa02d48bf1fcce3e192cd6299c15569fb0

4 years agoAvoid creating asyncio.Lock on the wrong loop.
Federico Caselli [Fri, 30 Apr 2021 20:36:59 +0000 (22:36 +0200)] 
Avoid creating asyncio.Lock on the wrong loop.

Fixed a regression introduced by :ticket:`6337` that would create an
``asyncio.Lock`` which could be attached to the wrong loop when
instantiating the async engine before any asyncio loop was started, leading
to an asyncio error message when attempting to use the engine under certain
circumstances.

Fixes: #6409
Change-Id: I8119c56b44a7bd70a650c0ea676892d4d7814a8b

4 years agoSupport filter_by() from columns, functions, Core SQL
Mike Bayer [Sat, 1 May 2021 12:41:09 +0000 (08:41 -0400)] 
Support filter_by() from columns, functions, Core SQL

Fixed regression where :meth:`_orm.Query.filter_by` would not work if the
lead entity were a SQL function or other expression derived from the
primary entity in question, rather than a simple entity or column of that
entity. Additionally, improved the behavior of
:meth:`_sql.Select.filter_by` overall to work with column expressions even
in a non-ORM context.

Fixes: #6414
Change-Id: I316b5bf98293bec1ede08787f6181dd14be85419

4 years agotrack_on needs to be a fixed size, support sub-tuples
Mike Bayer [Fri, 30 Apr 2021 15:54:52 +0000 (11:54 -0400)] 
track_on needs to be a fixed size, support sub-tuples

Fixed regression in ``selectinload`` loader strategy that would cause it to
cache its internal state incorrectly when handling relationships that join
across more than one column, such as when using a composite foreign key.
The invalid caching would then cause other loader operations to fail.

Fixes: #6410
Change-Id: I9f95ccca3553e7fd5794c619be4cf85c02b04626

4 years agoVersion 1.4.13 placeholder
Mike Bayer [Thu, 29 Apr 2021 21:56:51 +0000 (17:56 -0400)] 
Version 1.4.13 placeholder

4 years ago- 1.4.12 rel_1_4_12
Mike Bayer [Thu, 29 Apr 2021 21:46:15 +0000 (17:46 -0400)] 
- 1.4.12