]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
3 years ago- 1.4.29 rel_1_4_29
Mike Bayer [Thu, 23 Dec 2021 02:08:12 +0000 (21:08 -0500)] 
- 1.4.29

3 years agoadd mariadb conf section
Mike Bayer [Thu, 23 Dec 2021 02:07:33 +0000 (21:07 -0500)] 
add mariadb conf section

Change-Id: I7686ab7a877895de33e9ca19217ae38cb5729238
(cherry picked from commit f37931d50c21c412418fbd19d4676042fb5292a9)

3 years agoMerge "add recursion check for with_loader_criteria() option" into rel_1_4
mike bayer [Thu, 23 Dec 2021 00:38:55 +0000 (00:38 +0000)] 
Merge "add recursion check for with_loader_criteria() option" into rel_1_4

3 years agoMerge "Fix missing class attributes when using __class_getitem__" into rel_1_4
mike bayer [Thu, 23 Dec 2021 00:36:56 +0000 (00:36 +0000)] 
Merge "Fix missing class attributes when using __class_getitem__" into rel_1_4

3 years agoFix missing class attributes when using __class_getitem__
Kai Mueller [Tue, 21 Dec 2021 20:00:30 +0000 (15:00 -0500)] 
Fix missing class attributes when using __class_getitem__

Fixed issue where the ``__class_getitem__()`` method of the generated
declarative base class by :func:`_orm.as_declarative` would lead to
inaccessible class attributes such as ``__table__``, for cases where a
``Generic[T]`` style typing declaration were used in the class hierarchy.
This is in continuation from the basic addition of ``__class_getitem__()``
in :ticket:`7368`. Pull request courtesy Kai Mueller.

Fixes: #7462
Closes: #7470
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7470
Pull-request-sha: d5e5765e0e5542149f116ed9ccff1b3e2e32dee5

Change-Id: I6418af6d34532ff181343884bd419d9c2684e617
(cherry picked from commit 3088df9820bd62b3edff15d39a7635e86d265300)

3 years agoadd recursion check for with_loader_criteria() option
Mike Bayer [Wed, 22 Dec 2021 20:33:11 +0000 (15:33 -0500)] 
add recursion check for with_loader_criteria() option

Fixed recursion overflow which could occur within ORM statement compilation
when using either the :func:`_orm.with_loader_criteria` feature or the the
:meth:`_orm.PropComparator.and_` method within a loader strategy in
conjunction with a subquery which referred to the same entity being altered
by the criteria option, or loaded by the loader strategy.  A check for
coming across the same loader criteria option in a recursive fashion has
been added to accommodate for this scenario.

Fixes: #7491
Change-Id: I8701332717c45a21948ea4788a3058c0fbbf03a7
(cherry picked from commit c66c6d1aeff92f838740b7745a9c2a47852949d6)

3 years agouse fully qualified, locatable names for all use of api.named_type()
Mike Bayer [Wed, 22 Dec 2021 21:21:33 +0000 (16:21 -0500)] 
use fully qualified, locatable names for all use of api.named_type()

Fixed mypy regression where the release of mypy 0.930 added additional
internal checks to the format of "named types", requiring that they be
fully qualified and locatable. This broke the mypy plugin for SQLAlchemy,
raising an assertion error, as there was use of symbols such as
``__builtins__`` and other un-locatable or unqualified names that
previously had not raised any assertions.

Fixes: #7496
Change-Id: I037680606a1d51158ef6503508ec76c5d5adc946
(cherry picked from commit aded8b11d9eccbd1f2b645a94338e34a3d234bc9)

3 years agoaccommodate for "clone" of ColumnClause
Mike Bayer [Tue, 21 Dec 2021 23:08:33 +0000 (18:08 -0500)] 
accommodate for "clone" of ColumnClause

for use with the ClauseElement.params() method,
altered ColumnClause._clone() so that while the element
stays immutable, if the column is associated with a subquery,
it returns a new version of itself as corresponding to a
clone of the subquery.  this allows processing functions
to access the parameters in the subquery and produce a
copy of it.  The use case here is the expanded use of
.params() within loader strategies that use
HasCacheKey._apply_params_to_element().

Fixed issue in new "loader criteria" method
:meth:`_orm.PropComparator.and_` where usage with a loader strategy like
:func:`_orm.selectinload` against a column that was a member of the ``.c.``
collection of a subquery object, where the subquery would be dynamically
added to the FROM clause of the statement, would be subject to stale
parameter values within the subquery in the SQL statement cache, as the
process used by the loader strategy to replace the parameters at execution
time would fail to accommodate the subquery when received in this form.

Fixes: #7489
Change-Id: Ibb3b6af140b8a62a2c8d05b2ac92e86ca3013c46
(cherry picked from commit 267e9cbf6e3c165a4e953b49d979d7f4ddc533f9)

3 years agoinclude InterfaceError for mariadb disconnect check
Mike Bayer [Tue, 14 Dec 2021 21:46:50 +0000 (16:46 -0500)] 
include InterfaceError for mariadb disconnect check

Corrected the error classes inspected for the "is_disconnect" check for the
``mariadbconnector`` dialect, which was failing for disconnects that
occurred due to common MySQL/MariaDB error codes such as 2006; the DBAPI
appears to currently use the ``mariadb.InterfaceError`` exception class for
disconnect errors such as error code 2006, which has been added to the list
of classes checked.

For the current "real reconnect test", shutting down the mariadb
connection from the client side produces
ProgrammingError("Connection isn't valid anymore") which we also
continue to intercept.

Fixes: #7457
Change-Id: I0b37cd7a73359a23ad756ff2af0a9333c841221b
(cherry picked from commit 3a33fa8b0acd9220ef4428ac6a56ebd8d40c3762)

3 years agoIgnore ephemeral classes in test_all_present()
Nils Philippsen [Sun, 12 Dec 2021 23:35:03 +0000 (18:35 -0500)] 
Ignore ephemeral classes in test_all_present()

Fixed a regression in the test suite where the test called
``CompareAndCopyTest::test_all_present`` would fail on some platforms due
to additional testing artifacts being detected. Pull request courtesy Nils
Philippsen.

In some circumstances, ephemeral class objects that are created within
the scope of a test method don't seem to be garbage collected directly
on exit. Filter out classes created in test modules.

Fixes: #7450
Closes: #7451
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7451
Pull-request-sha: 135a8aaba2c6941460c7f45aa1a55c8f6b9eb43d

Change-Id: I621967bd916089dc1e3f98625fd2a852cd9fd712
(cherry picked from commit 4291e3c235569031948ebaacec4dde8776255e0e)

3 years agoMerge "implement correct errors for Row immutability" into rel_1_4
mike bayer [Sun, 12 Dec 2021 23:29:27 +0000 (23:29 +0000)] 
Merge "implement correct errors for Row immutability" into rel_1_4

3 years agoMerge "check for string_types, not str, for py2 support" into rel_1_4
mike bayer [Sun, 12 Dec 2021 20:18:38 +0000 (20:18 +0000)] 
Merge "check for string_types, not str, for py2 support" into rel_1_4

3 years agouse the options from the cached statement for propagate_options
Mike Bayer [Sun, 12 Dec 2021 18:37:21 +0000 (13:37 -0500)] 
use the options from the cached statement for propagate_options

Fixed caching-related issue where the use of a loader option of the form
``lazyload(aliased(A).bs).joinedload(B.cs)`` would fail to result in the
joinedload being invoked for runs subsequent to the query being cached, due
to a mismatch for the options / object path applied to the objects loaded
for a query with a lead entity that used ``aliased()``.

Fixes: #7447
Change-Id: I4e9c34654b7d3668cd8878decbd688afe2af5f81
(cherry picked from commit 04421c8bed9e93a625b7164e99eb1ee0395bebfe)

3 years agocheck for string_types, not str, for py2 support
Mike Bayer [Sun, 12 Dec 2021 16:23:07 +0000 (11:23 -0500)] 
check for string_types, not str, for py2 support

Fixed regression in the :func:`_engine.make_url` function used to parse URL
strings where the query string parsing would go into a recursion overflow
if a Python 2 ``u''`` string were used.

Fixes: #7446
Change-Id: I081275673e6240a52f71da7dfaaf04e6fe32cf48

3 years agoFix referenced ticket number (#7439)
Nils Philippsen [Sat, 11 Dec 2021 16:24:22 +0000 (17:24 +0100)] 
Fix referenced ticket number (#7439)

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
3 years agoMerge "Add execution options to ``Session.get``" into rel_1_4
Federico Caselli [Sat, 11 Dec 2021 08:09:32 +0000 (08:09 +0000)] 
Merge "Add execution options to ``Session.get``" into rel_1_4

3 years agoMerge "Add async_engine_from_config()" into rel_1_4
Federico Caselli [Sat, 11 Dec 2021 08:07:28 +0000 (08:07 +0000)] 
Merge "Add async_engine_from_config()" into rel_1_4

3 years agoAdd ``scalars`` to Migration - ORM Usage table.
Federico Caselli [Thu, 9 Dec 2021 21:41:47 +0000 (22:41 +0100)] 
Add ``scalars`` to Migration - ORM Usage table.

Fixes #7407

Change-Id: I0ec7c0dd44dce3b907296824ee4e6103bc72a6dd
(cherry picked from commit d692b11608f540e4d4df8f4127ee52a476e0e5e4)

3 years agoAdd async_engine_from_config()
Nils Philippsen [Sat, 13 Nov 2021 16:11:32 +0000 (11:11 -0500)] 
Add async_engine_from_config()

Added :func:`_asyncio.async_engine_config` function to create
an async engine from a configuration dict.  This otherwise
behaves the same as :func:`_sa.engine_from_config`.

Fixes: #7301
Closes: #7302
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7302
Pull-request-sha: c7c758833b6c37b7509b8c5bed4f26ac0ccc0395

Change-Id: I64feadf95b5015c24fe0fa0dbae6755b72d1713e
(cherry picked from commit 98b1650efce79ae6d304eb08047890ef8ae89df1)

3 years agoAdd execution options to ``Session.get``
Federico Caselli [Thu, 9 Dec 2021 21:11:37 +0000 (22:11 +0100)] 
Add execution options to ``Session.get``

Fixes: #7410
Change-Id: Iab6427b8b4c2ada8c31ef69f92d27c1185dbb6b1
(cherry picked from commit ec1fee363e7d538a2239818cfb1e341eddddcf36)

3 years agoMerge branch 'postgresql-docs-update-table-numbers_1_4' into rel_1_4
Federico Caselli [Fri, 10 Dec 2021 13:28:36 +0000 (14:28 +0100)] 
Merge branch 'postgresql-docs-update-table-numbers_1_4' into rel_1_4

Change-Id: I0856b0dfff3116b4e9685bc8f7dec60c4ac31b42

3 years agoUpdate references to tables in PostgreSQL documentation
Leo Singer [Fri, 8 Oct 2021 02:07:08 +0000 (22:07 -0400)] 
Update references to tables in PostgreSQL documentation

Since the table numbers change from one version of PostgreSQL to
the next, refer to the tables by name rather than by number.

(cherry picked from commit 786bc099743285ca4af3786d8f54cd59ce7a7c81)

3 years agoInclude import error message when greenlet is not installed
Federico Caselli [Thu, 9 Dec 2021 20:47:22 +0000 (21:47 +0100)] 
Include import error message when greenlet is not installed

Fixes: #7419
Change-Id: I0c604875a80287acff3bab732f67601a5e2db98c
(cherry picked from commit 533f5718904b620be8d63f2474229945d6f8ba5d)

3 years agoVersion 1.4.29 placeholder
Mike Bayer [Thu, 9 Dec 2021 19:50:36 +0000 (14:50 -0500)] 
Version 1.4.29 placeholder

3 years ago- 1.4.28 rel_1_4_28
Mike Bayer [Thu, 9 Dec 2021 19:35:43 +0000 (14:35 -0500)] 
- 1.4.28

3 years agoMerge branch 'typos-fixes_1_4' into rel_1_4
Federico Caselli [Thu, 9 Dec 2021 19:27:19 +0000 (20:27 +0100)] 
Merge branch 'typos-fixes_1_4' into rel_1_4

Change-Id: I6d53b7e7b9538cc8bea9ab5af4b0fa383f52d7cf

3 years agoFix typo in changelog
Lele Gaifax [Thu, 9 Dec 2021 07:13:42 +0000 (08:13 +0100)] 
Fix typo in changelog

3 years agoFix typo in docstring
Lele Gaifax [Thu, 9 Dec 2021 07:14:06 +0000 (08:14 +0100)] 
Fix typo in docstring

(cherry picked from commit 9fd1bb4e8bf8a21f8c20b4390a9e7d579556ffc0)

3 years agoimplement correct errors for Row immutability
Mike Bayer [Thu, 9 Dec 2021 19:23:42 +0000 (14:23 -0500)] 
implement correct errors for Row immutability

Corrected the error message for the ``AttributeError`` that's raised when
attempting to write to an attribute on the :class:`_result.Row` class,
which is immutable. The previous message claimed the column didn't exist
which is misleading.

Fixes: #7432
Change-Id: If0e2cbd3f763dca6c99a18aa42252c69f1207d59
(cherry picked from commit f113e979219e20a22044c4b262e4531ba9993b8a)

3 years agoimplement attributes.Proxy._clone()
Mike Bayer [Thu, 9 Dec 2021 17:51:43 +0000 (12:51 -0500)] 
implement attributes.Proxy._clone()

Fixed issue where the internal cloning used by the
:meth:`_orm.PropComparator.any` method on a :func:`_orm.relationship` in
the case where the related class also makes use of ORM polymorphic loading,
would fail if a hybrid property on the related, polymorphic class were used
within the criteria for the ``any()`` operation.

Fixes: #7425
Change-Id: I5f4f4ec5fab17df228bc6e3de412d24114b20600
(cherry picked from commit 546391e5a80f647e7ad78ef93f832f10278a8867)

3 years agochangelog updates
Mike Bayer [Thu, 9 Dec 2021 17:36:25 +0000 (12:36 -0500)] 
changelog updates

Change-Id: Ie136cfb7375e68b2badba1099b5b041f99da85fa
(cherry picked from commit af50c8064d668ba33ef2399a288fd1594b1b5602)

3 years agoMerge "Warn when caching is disabled / document" into rel_1_4
mike bayer [Tue, 7 Dec 2021 15:47:12 +0000 (15:47 +0000)] 
Merge "Warn when caching is disabled / document" into rel_1_4

3 years agoMerge "contextmanager skips rollback if trans says to skip it" into rel_1_4
mike bayer [Tue, 7 Dec 2021 14:53:38 +0000 (14:53 +0000)] 
Merge "contextmanager skips rollback if trans says to skip it" into rel_1_4

3 years agoWarn when caching is disabled / document
Mike Bayer [Fri, 3 Dec 2021 19:04:05 +0000 (14:04 -0500)] 
Warn when caching is disabled / document

This patch adds new warnings for all elements that
don't indicate their caching behavior, including user-defined
ClauseElement subclasses and third party dialects.
it additionally adds new documentation to discuss an apparent
performance degradation in 1.4 when caching is disabled as a
result in the significant expense incurred by ORM
lazy loaders, which in 1.3 used BakedQuery so were actually
cached.

As a result of adding the warnings, a fair degree of
lesser used SQL expression objects identified that they did not
define caching behavior so would have been producing
``[no key]``, including PostgreSQL constructs ``hstore``
and ``array``.  These have been amended to use inherit
cache where appropriate.  "on conflict" constructs in
PostgreSQL, MySQL, SQLite still explicitly don't generate
a cache key at this time.

The change also adds a test for all constructs via
assert_compile() to assert they will not generate cache
warnings.

Fixes: #7394
Change-Id: I85958affbb99bfad0f5efa21bc8f2a95e7e46981
(cherry picked from commit 22deafe15289d2be55682e1632016004b02b62c0)

3 years agoAdd __copy__, __deepcopy__ to URL. Fixes: #7400
Tom Ritchford [Sun, 5 Dec 2021 18:27:45 +0000 (13:27 -0500)] 
Add __copy__, __deepcopy__ to URL. Fixes: #7400

Added support for ``copy()`` and ``deepcopy()`` to the :class:`_url.URL`
class. Pull request courtesy Tom Ritchford.

Fixes: #7400
Closes: #7401
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7401
Pull-request-sha: a2c1b8992f5d153c6210178cda47b8ae96b91fb5

Change-Id: I55977338b2655a7d4f733ae786d31e589185e9ca
(cherry picked from commit 924cc31975f8874d369db6599575e361bdb34be9)

3 years agocontextmanager skips rollback if trans says to skip it
Mike Bayer [Thu, 2 Dec 2021 00:27:25 +0000 (19:27 -0500)] 
contextmanager skips rollback if trans says to skip it

Fixed issue where if an exception occurred when the :class:`_orm.Session`
were to close the connection within the :meth:`_orm.Session.commit` method,
when using a context manager for :meth:`_orm.Session.begin` , it would
attempt a rollback which would not be possible as the :class:`_orm.Session`
was in between where the transaction is committed and the connection is
then to be returned to the pool, raising the exception "this
sessiontransaction is in the committed state". This exception can occur
mostly in an asyncio context where CancelledError can be raised.

Fixes: #7388
Change-Id: I1a85a3a7eae79f3553ddf1e3d245a0d90b0a2f40
(cherry picked from commit a845da8b0fc5bb172e278c399a1de9a2e49d62af)

3 years agoqualify the stringification warning
Mike Bayer [Mon, 6 Dec 2021 17:41:36 +0000 (12:41 -0500)] 
qualify the stringification warning

the recipe which uses render_postcompile itself is
not insecure as it still renders bound parameters
and does not stringify any literal values.

Change-Id: Ib5ac2f7ce37dc1415a67b117a9c31c0ee37270b3
(cherry picked from commit 973b6ccbf1f81d2357d310ed44717fe37df96ac6)

3 years agofix typo in exists documentation
Federico Caselli [Sun, 5 Dec 2021 21:14:51 +0000 (22:14 +0100)] 
fix typo in exists documentation

Change-Id: I71773e32ae69bad10642f2f3c7b73a80045e7b8b

3 years agoThe where method of exists now accepts multiple cluase.
Federico Caselli [Sat, 4 Dec 2021 22:08:05 +0000 (23:08 +0100)] 
The where method of exists now accepts multiple cluase.

Support multiple clause elements in the :meth:`_sql.Exists.where` method,
unifying the api with the on presented by a normal :func:`_sql.select`
construct.

Fixes: #7386
Change-Id: I5df20478008cd5167053d357cbfad8a641c62b44
(cherry picked from commit b2bc0c8e4138ccef4834a415f7be9012e1c6286e)

3 years agoMerge "copy list for __iadd__" into rel_1_4
mike bayer [Fri, 3 Dec 2021 15:34:31 +0000 (15:34 +0000)] 
Merge "copy list for __iadd__" into rel_1_4

3 years agoblock class_getitem test for python 3.6
Mike Bayer [Thu, 2 Dec 2021 21:07:51 +0000 (16:07 -0500)] 
block class_getitem test for python 3.6

This commit in 3d4e64b8ef6 wont work on python 3.6.

Change-Id: I8e39268914ee972247e6cf54f6c07366e0033133

3 years agocopy list for __iadd__
Mike Bayer [Thu, 2 Dec 2021 02:39:59 +0000 (21:39 -0500)] 
copy list for __iadd__

Fixed issue where a list mapped with :func:`_orm.relationship` would go
into an endless loop if in-place added to itself, i.e. the ``+=`` operator
were used, as well as if ``.extend()`` were given the same list.

Fixes: #7389
Change-Id: Idd5118420f8bc684d1ee36b2b6d4c5812f36cc4c
(cherry picked from commit 9fc17513fe69a1fd26fc522f9862af3e0ebfd2c4)

3 years agoAdd __class_getitem__ to the declarative Base class
Kai Mueller [Wed, 1 Dec 2021 15:58:40 +0000 (10:58 -0500)] 
Add __class_getitem__ to the declarative Base class

Fixed issue where the :func:`_orm.as_declarative` decorator and similar
functions used to generate the declarative base class would not copy the
``__class_getitem__()`` method from a given superclass, which prevented the
use of pep-484 generics in conjunction with the ``Base`` class. Pull
request courtesy Kai Mueller.

Fixes: #7368
Closes: #7381
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7381
Pull-request-sha: 7db7fd869a6bb617f767fad5b71ddf7cb5f14ff5

Change-Id: I495718c3082ad6dd2c83fdbf6feba7c529e351cb
(cherry picked from commit 20fe2a3dc2597b04338e8907883c6f4ea72518c8)

3 years agoMerge "Fixes: #4390" into rel_1_4
mike bayer [Tue, 30 Nov 2021 15:54:57 +0000 (15:54 +0000)] 
Merge "Fixes: #4390" into rel_1_4

3 years agoMerge "document get_bind() overrides for async session" into rel_1_4
mike bayer [Tue, 30 Nov 2021 15:49:06 +0000 (15:49 +0000)] 
Merge "document get_bind() overrides for async session" into rel_1_4

3 years agoscoped_session adjustments
Mike Bayer [Tue, 30 Nov 2021 14:06:29 +0000 (09:06 -0500)] 
scoped_session adjustments

* fix typo, change to a note the async scoped session note
* more dragons re: threading.local()

Change-Id: I76266507510e4014456d992656f4aadf6d03ba4a
(cherry picked from commit 912bdcc8075c640a4f3d9e0194f57b5bdcfc6f2b)

3 years agodocument get_bind() overrides for async session
Mike Bayer [Mon, 29 Nov 2021 22:00:21 +0000 (17:00 -0500)] 
document get_bind() overrides for async session

Change-Id: Ifcc936a5861d49857d1f365416190cfbd0981aac
References: #7383
(cherry picked from commit 250725ab7bbeafbed650f8ecb286ffad01078801)

3 years agoadapt pytest plugin to support pytest v7
Federico Caselli [Sat, 27 Nov 2021 08:53:29 +0000 (09:53 +0100)] 
adapt pytest plugin to support pytest v7

Implemented support for the test suite to run correctly under Pytest 7.
Previously, only Pytest 6.x was supported for Python 3, however the version
was not pinned on the upper bound in tox.ini. Pytest is not pinned in
tox.ini to be lower than version 8 so that SQLAlchemy versions released
with the current codebase will be able to be tested under tox without
changes to the environment.   Much thanks to the Pytest developers for
their help with this issue.

Change-Id: I3b12166199be2b913ee16e78b3ebbff415654396
(cherry picked from commit 7f84297c9947ff8d52b091aedb2a46035791763c)

3 years agoupdate migration strategy for dynamic loaders
Mike Bayer [Sat, 27 Nov 2021 19:29:00 +0000 (14:29 -0500)] 
update migration strategy for dynamic loaders

discuss the two current ways for this use case that
use 2.0 style querying and introduce that a newer API
is likely on the way.

Also repair autofunctions for with_parent for 2.0 only.

References: #7123
References: #7372

Change-Id: I2ff6cfd780540ee4ee887b61137af7afa1327a9f
(cherry picked from commit 29c5fba9ad89e53180f0bd2a026742321093105f)

3 years agofix execution options docs local to 1.4
Mike Bayer [Thu, 25 Nov 2021 00:47:57 +0000 (19:47 -0500)] 
fix execution options docs local to 1.4

the cherry-pick in c37ef701638e27863a7af768ba8
went in cleanly but failed to accommodate that
the spacing here was still wrong in a different way.

Change-Id: Ife87fb01aec3eae2ae9635e6951330279f29471b

3 years agoImprove ``ORMExecuteState`` documentation
Federico Caselli [Wed, 24 Nov 2021 14:11:04 +0000 (15:11 +0100)] 
Improve ``ORMExecuteState`` documentation

(cherry picked from commit 7c3d3670c68298e88d03bc8f02e01c6a3f7fe42f)

3 years agofix year
Mike Bayer [Sun, 21 Nov 2021 16:50:27 +0000 (11:50 -0500)] 
fix year

Change-Id: I56a325fde167501a53b588cc1b69255238ac1dbb
(cherry picked from commit 3085f28be58bf4e4a0318b932f1422c49e1af2f1)

3 years agoMerge "favor setuptools imports over distutils" into rel_1_4
mike bayer [Fri, 19 Nov 2021 14:30:16 +0000 (14:30 +0000)] 
Merge "favor setuptools imports over distutils" into rel_1_4

3 years agoMerge "generalize cache_ok to UserDefinedType" into rel_1_4
mike bayer [Fri, 19 Nov 2021 14:30:03 +0000 (14:30 +0000)] 
Merge "generalize cache_ok to UserDefinedType" into rel_1_4

3 years agoMerge "disable raiseerr for refresh state loader options" into rel_1_4
mike bayer [Thu, 18 Nov 2021 20:51:01 +0000 (20:51 +0000)] 
Merge "disable raiseerr for refresh state loader options" into rel_1_4

3 years agouse typing.Dict
Mike Bayer [Thu, 18 Nov 2021 18:39:54 +0000 (13:39 -0500)] 
use typing.Dict

newer Pythons seem to accept ``dict[Any, Any]`` which is why
this wasn't noticed.  Revise fix for #7321 made in
I55656e867876677c5c55143449db371344be8600.

Fixes: #7321
Change-Id: Idc22e15d098543e07853f4532cfd1aaae4dd6404
(cherry picked from commit 2fe72b977506562811d3b4dce1c138f0a69f7ad4)

3 years agodisable raiseerr for refresh state loader options
Mike Bayer [Thu, 18 Nov 2021 17:46:25 +0000 (12:46 -0500)] 
disable raiseerr for refresh state loader options

Fixed ORM regression where the new behavior of "eager loaders run on
unexpire" added in :ticket:`1763` would lead to loader option errors being
raised inappropriately for the case where a single :class:`_orm.Query` or
:class:`_sql.Select` were used to load multiple kinds of entities, along
with loader options that apply to just one of those kinds of entity like a
:func:`_orm.joinedload`, and later the objects would be refreshed from
expiration, where the loader options would attempt to be applied to the
mismatched object type and then raise an exception. The check for this
mismatch now bypasses raising an error for this case.

Fixes: #7318
Change-Id: I111e0f3e0fb0447355574cbdcde002f734833490
(cherry picked from commit d4c170238dc95eeb2dc7e6c5e03270fbc8b36f8f)

3 years agofavor setuptools imports over distutils
Mike Bayer [Mon, 15 Nov 2021 20:06:06 +0000 (15:06 -0500)] 
favor setuptools imports over distutils

Python 3.10 has deprecated "distutils" in favor of explicit use of
"setuptools" in :pep:`632`; SQLAlchemy's setup.py has replaced imports
accordingly. However, since setuptools itself only recently added the
replacement symbols mentioned in pep-632 as of November of 2022 in version
59.0.1, ``setup.py`` still has fallback imports to distutils, as SQLAlchemy
1.4 does not have a hard setuptools versioning requirement at this time.
SQLAlchemy 2.0 is expected to use a full :pep:`517` installation layout
which will indicate appropriate setuptools versioning up front.

Fixes: #7311
Change-Id: I215ef3c3b226a38266f59d181214aea462c4664d
(cherry picked from commit e6c02c33728a581e0df910caa8d96b6e114c114d)

3 years agoMerge "Add new sections regarding schemas and reflection" into rel_1_4
mike bayer [Thu, 18 Nov 2021 16:14:44 +0000 (16:14 +0000)] 
Merge "Add new sections regarding schemas and reflection" into rel_1_4

3 years agohandle dunder names in @declared_attr separately
Mike Bayer [Mon, 15 Nov 2021 01:02:10 +0000 (20:02 -0500)] 
handle dunder names in @declared_attr separately

Fixed Mypy crash which would occur when using Mypy plugin against code
which made use of :class:`_orm.declared_attr` methods for non-mapped names
like ``__mapper_args__``, ``__table_args__``, or other dunder names, as the
plugin would try to interpret these as mapped attributes which would then
be later mis-handled. As part of this change, the decorated function is
still converted by the plugin into a generic assignment statement (e.g.
``__mapper_args__: Any``) so that the argument signature can continue to be
annotated in the same way one would for any other ``@classmethod`` without
Mypy complaining about the wrong argument type for a method that isn't
explicitly ``@classmethod``.

Fixes: #7321
Change-Id: I55656e867876677c5c55143449db371344be8600
(cherry picked from commit 836902bc8438a800d2c9cf1452da31d3ca967f3b)

3 years agoAdd new sections regarding schemas and reflection
jonathan vanasco [Mon, 27 Sep 2021 16:41:24 +0000 (12:41 -0400)] 
Add new sections regarding schemas and reflection

* add a new section to reflection.rst `Schemas and Reflection`.
  * this contains some text from the ticket
* migrate some text from `Specifying the Schema Name` to new section
* migrate some text from PostgreSQL dialect to new section
  * target text is made more generic
  * cross-reference the postgres and new sections to one another, to avoid duplication of docs
* update some docs 'meta' to 'metadata_obj'

Fixes: #4387
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I2b08672753fb2575d30ada07ead77587468fdade
(cherry picked from commit 0fa0beacb465c61e792c97d530a0e8fdd7139256)

3 years agogeneralize cache_ok to UserDefinedType
Mike Bayer [Wed, 17 Nov 2021 20:08:29 +0000 (15:08 -0500)] 
generalize cache_ok to UserDefinedType

Extended the ``cache_ok`` flag and corresponding warning message if this
flag is not defined, a behavior first established for
:class:`.TypeDecorator` as part of :ticket:`6436`, to also take place for
:class:`.UserDefinedType`, by generalizing the flag and associated caching
logic to a new common base for these two types, :class:`.ExternalType`.

The change means any current :class:`.UserDefinedType` will now cause SQL
statement caching to no longer take place for statements which make use of
the datatype, along with a warning being emitted, unless the class defines
the :attr:`.UserDefinedType.cache_ok` flag as True. If the datatype cannot
form a deterministic, hashable cache key derived from its arguments, it may return
False which will continue to keep caching disabled but will suppress the
warning. In particular, custom datatypes currently used in packages such as
SQLAlchemy-utils will need to implement this flag. The issue was observed
as a result of a SQLAlchemy-utils datatype that is not currently cacheable.

Fixes: #7319
Change-Id: Ie0b5d4587df87bfe66d2fe7cd4585c3882584575
(cherry picked from commit 4761e6878b127f7d5fb09addaae15426edbb0b73)

3 years agoAdd Non linear CTE support
Eric Masseran [Tue, 2 Nov 2021 20:40:04 +0000 (16:40 -0400)] 
Add Non linear CTE support

"Compound select" methods like :meth:`_sql.Select.union`,
:meth:`_sql.Select.intersect_all` etc. now accept ``*other`` as an argument
rather than ``other`` to allow for multiple additional SELECTs to be
compounded with the parent statement at once. In particular, the change as
applied to :meth:`_sql.CTE.union` and :meth:`_sql.CTE.union_all` now allow
for a so-called "non-linear CTE" to be created with the :class:`_sql.CTE`
construct, whereas previously there was no way to have more than two CTE
sub-elements in a UNION together while still correctly calling upon the CTE
in recursive fashion. Pull request courtesy Eric Masseran.

Allow:

```sql
WITH RECURSIVE nodes(x) AS (
   SELECT 59
   UNION
   SELECT aa FROM edge JOIN nodes ON bb=x
   UNION
   SELECT bb FROM edge JOIN nodes ON aa=x
)
SELECT x FROM nodes;
```

Based on @zzzeek suggestion: https://github.com/sqlalchemy/sqlalchemy/pull/7133#issuecomment-933882348

Fixes: #7259
Closes: #7260
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7260
Pull-request-sha: 2565a5fd4b1940e92125e53aeaa731cc682f49bb

Change-Id: I685c8379762b5fb6ab4107ff8f4d8a4de70c0ca6
(cherry picked from commit 958f902b1fc528fed0be550bc573545de47ed854)

3 years agoVersion 1.4.28 placeholder
Mike Bayer [Thu, 11 Nov 2021 15:48:50 +0000 (10:48 -0500)] 
Version 1.4.28 placeholder

3 years ago- 1.4.27 rel_1_4_27
Mike Bayer [Thu, 11 Nov 2021 15:42:08 +0000 (10:42 -0500)] 
- 1.4.27

3 years agoqualify asyncpg API tests for python 3.8
Mike Bayer [Wed, 10 Nov 2021 14:52:18 +0000 (09:52 -0500)] 
qualify asyncpg API tests for python 3.8

Getting
TypeError: object MagicMock can't be used in 'await' expression
for Python 3.7 and earlier.  this test is not needed
on all platforms it's confirming that two methods
are present.

Change-Id: If918add023c98c062ea0c1cd132a999647a2d35f
(cherry picked from commit 2c41cd99d8a4d8bb27c975f5e2511ab2bf261110)

3 years agoMerge "set within_columns_clause=False for all sub-elements of select()" into rel_1_4
mike bayer [Tue, 9 Nov 2021 23:56:20 +0000 (23:56 +0000)] 
Merge "set within_columns_clause=False for all sub-elements of select()" into rel_1_4

3 years agoMerge "upgrade deferred loader to regular loader if refresh_state" into rel_1_4
mike bayer [Tue, 9 Nov 2021 23:55:19 +0000 (23:55 +0000)] 
Merge "upgrade deferred loader to regular loader if refresh_state" into rel_1_4

3 years agoMerge "change the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting" into...
mike bayer [Tue, 9 Nov 2021 23:52:38 +0000 (23:52 +0000)] 
Merge "change the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting" into rel_1_4

3 years agochange the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting
Mike Bayer [Mon, 8 Nov 2021 23:29:16 +0000 (18:29 -0500)] 
change the POSTCOMPILE/ SCHEMA symbols to not conflict w mssql quoting

Adjusted the compiler's generation of "post compile" symbols including
those used for "expanding IN" as well as for the "schema translate map" to
not be based directly on plain bracketed strings with underscores, as this
conflicts directly with SQL Server's quoting format of also using brackets,
which produces false matches when the compiler replaces "post compile" and
"schema translate" symbols. The issue created easy to reproduce examples
both with the :meth:`.Inspector.get_schema_names` method when used in
conjunction with the
:paramref:`_engine.Connection.execution_options.schema_translate_map`
feature, as well in the unlikely case that a symbol overlapping with the
internal name "POSTCOMPILE" would be used with a feature like "expanding
in".

Fixes: #7300
Change-Id: I6255c850b140522a4aba95085216d0bca18ce230
(cherry picked from commit b919a0a85afd5066f9188b20ef06ee1b4af884a9)

3 years agoset within_columns_clause=False for all sub-elements of select()
Mike Bayer [Tue, 9 Nov 2021 20:02:44 +0000 (15:02 -0500)] 
set within_columns_clause=False for all sub-elements of select()

Fixed issue where using the feature of using a string label for ordering or
grouping described at :ref:`tutorial_order_by_label` would fail to function
correctly if used on a :class:`.CTE` construct, when the CTE were embedded
inside of an enclosing :class:`_sql.Select` statement that itself was set
up as a scalar subquery.

Fixes: #7269
Change-Id: Ied6048a1c9a622374a418230c8cfedafa8d3f87e
(cherry picked from commit 89661c1a218b7117c1835698dbb81836e72015ae)

3 years agoupgrade deferred loader to regular loader if refresh_state
Mike Bayer [Tue, 9 Nov 2021 16:31:23 +0000 (11:31 -0500)] 
upgrade deferred loader to regular loader if refresh_state

Fixed issue where deferred polymorphic loading of attributes from a
joined-table inheritance subclass would fail to populate the attribute
correctly if the :func:`_orm.load_only` option were used to originally
exclude that attribute, in the case where the load_only were descending
from a relationship loader option.  The fix allows that other valid options
such as ``defer(..., raiseload=True)`` etc. still function as expected.

Fixes: #7304
Change-Id: I58b7ce7c450bcc52d2f0c9bfbcb4d747463ee9b2
(cherry picked from commit 52b3d6649525929ee1ec14487a2f007194ed741d)

3 years agoFixes: #4390
jonathan vanasco [Mon, 27 Sep 2021 16:51:32 +0000 (12:51 -0400)] 
Fixes: #4390
Deprecated an undocumented loader option syntax ``".*"``, which appears to
be no different than passing a single asterisk, and will emit a deprecation
warning if used. This syntax may have been intended for something but there
is currently no need for it.

The original ticket was to document the `.{WILDCARD}` (e.g. `.*`) format,
however this format does not appear to be used or needed by SQLAlchemy
and is likely not used by any projects or developers.

This PR invokes `util.warn_deprecated` to notify users this functionality
is deprecated, and directs them to the #4390 issue if they actually use it.

Assuming there are no complaints over this warning in the coming months,
this code can be removed in a future major release.

Change-Id: I665e3ac26be0a7819246a2ee56fb5a5f32980c91
(cherry picked from commit 2432d2ed0b28480c0e1004a47aa74238865105b5)

3 years agoFixes: #7295
jonathan vanasco [Fri, 5 Nov 2021 16:38:30 +0000 (12:38 -0400)] 
Fixes: #7295
Fixed issue in ``Table``` object where: param:`implicit_returning` was not
compatible with: param:`extend_existing`.

(cherry picked from commit f5836f29f5612d5f653683644566a57c47291b5d)

Change-Id: I16f4ab585d82f5691a3fed9eba04b84730a8a59e

3 years agouse tuple expansion if type._is_tuple, test for Sequence if no type
Mike Bayer [Fri, 5 Nov 2021 14:18:42 +0000 (10:18 -0400)] 
use tuple expansion if type._is_tuple, test for Sequence if no type

Fixed regression where the row objects returned for ORM queries, which are
now the normal :class:`_sql.Row` objects, would not be interpreted by the
:meth:`_sql.ColumnOperators.in_` operator as tuple values to be broken out
into individual bound parameters, and would instead pass them as single
values to the driver leading to failures. The change to the "expanding IN"
system now accommodates for the expression already being of type
:class:`.TupleType` and treats values accordingly if so. In the uncommon
case of using "tuple-in" with an untyped statement such as a textual
statement with no typing information, a tuple value is detected for values
that implement ``collections.abc.Sequence``, but that are not ``str`` or
``bytes``, as always when testing for ``Sequence``.

Added :class:`.TupleType` to the top level ``sqlalchemy`` import namespace.

Fixes: #7292
Change-Id: I8286387e3b3c3752b3bd4ae3560d4f31172acc22
(cherry picked from commit 0c44a1e77cfde0f841a4a64140314c6b833efdab)

3 years agofix typo in changelog.
Federico Caselli [Fri, 5 Nov 2021 08:58:18 +0000 (09:58 +0100)] 
fix typo in changelog.

Change-Id: Ic78a9ce9032ab759fc796d3218b64352dde6155b

3 years agoCheck for Mapping explicitly in 2.0 params
Mike Bayer [Thu, 4 Nov 2021 21:02:24 +0000 (17:02 -0400)] 
Check for Mapping explicitly in 2.0 params

Fixed issue in future :class:`_future.Connection` object where the
:meth:`_future.Connection.execute` method would not accept a non-dict
mapping object, such as SQLAlchemy's own :class:`.RowMapping` or other
``abc.collections.Mapping`` object as a parameter dictionary.

Fixes: #7291
Change-Id: I819f079d86d19d1d81c570e0680f987e51e34b84
(cherry picked from commit 248d232459e38561999c4172acaaddd651c1a933)

3 years agoUpdate "transaction has already begun" language
Mike Bayer [Thu, 4 Nov 2021 17:36:43 +0000 (13:36 -0400)] 
Update "transaction has already begun" language

As future connections will now be autobeginning, there
will be more cases where begin() can't be called as well as where isolation level
can't be set, which will be surprising as this is a behavioral
change for 2.0; additionally, when DBAPI autocommit is set,
there isn't actually a DBAPI level transaction in effect even though
Connection has a Transaction object.  Clarify the language in these
two error messages to make it clear that begin() and autobegin
are tracking a SQLAlchemy-level Transaction() object, whether or not
the DBAPI has actually started a transaction, and that this is the
reason rollback() or commit() is required before performing
the requsted operation.   Additionally make sure the error message
mentions "autobegin" as a likely reason this error is being
encountered along with what Connection needs the user to do in
order to resolve.

Change-Id: If8763939eeabc46aa9d9209a56d05ad82b892c5c
(cherry picked from commit fee0855bfe2982927ab21ce7398fa48b90af7ca4)

3 years agoMerge "simplify and publicize the asyncpg JSON(B) codec registrsation" into rel_1_4
mike bayer [Thu, 4 Nov 2021 16:28:02 +0000 (16:28 +0000)] 
Merge "simplify and publicize the asyncpg JSON(B) codec registrsation" into rel_1_4

3 years agosimplify and publicize the asyncpg JSON(B) codec registrsation
Mike Bayer [Wed, 3 Nov 2021 15:32:51 +0000 (11:32 -0400)] 
simplify and publicize the asyncpg JSON(B) codec registrsation

Added overridable methods ``PGDialect_asyncpg.setup_asyncpg_json_codec``
and ``PGDialect_asyncpg.setup_asyncpg_jsonb_codec`` codec, which handle the
required task of registering JSON/JSONB codecs for these datatypes when
using asyncpg. The change is that methods are broken out as individual,
overridable methods to support third party dialects that need to alter or
disable how these particular codecs are set up.

Fixes: #7284
Change-Id: I3eac258fea61f3975bd03c428747f788813ce45e
(cherry picked from commit 8bd8f6c5aa1e85907b1517a57a91997532f3ebd7)

3 years agouse ExpressionElementRole for case targets in case()
Mike Bayer [Thu, 4 Nov 2021 01:26:44 +0000 (21:26 -0400)] 
use ExpressionElementRole for case targets in case()

Fixed regression where the :func:`_sql.text` construct would no longer be
accepted as a target case in the "whens" list within a :func:`_sql.case`
construct. The regression appears related to an attempt to guard against
some forms of literal values that were considered to be ambiguous when
passed here; however, there's no reason the target cases shouldn't be
interpreted as open-ended SQL expressions just like anywhere else, and a
literal string or tuple will be converted to a bound parameter as would be
the case elsewhere.

Fixes: #7287
Change-Id: I75478adfa115f3292cb1362cc5b2fdf152b0ed6f
(cherry picked from commit 77a17797ecc08736ea942e29f79df4f96bd74e0c)

3 years agoadd missing info from groupby documentation
Federico Caselli [Wed, 3 Nov 2021 21:47:51 +0000 (22:47 +0100)] 
add missing info from groupby documentation

Change-Id: Icfaf242353c23a579fe79f9d72500a08d90fcb77
Signed-off-by: Federico Caselli <cfederico87@gmail.com>
3 years agoRevert "Gracefully degrade unsupported types with asyncpg"
mike bayer [Wed, 3 Nov 2021 15:13:22 +0000 (15:13 +0000)] 
Revert "Gracefully degrade unsupported types with asyncpg"

This reverts commit 96c294da8a50d692b3f0b8e508dbbca5d9c22f1b.

I have another approach that is more obvious, easier to override explicitly and also I can test it more easily.

Change-Id: I11a3be7700dbc6f25d436e450b6fb8e8f6c4fd16
(cherry picked from commit 2cc49191e28bcf05d97787d6cdc561dd6815e847)

3 years agoformatting updates
Mike Bayer [Wed, 3 Nov 2021 15:01:08 +0000 (11:01 -0400)] 
formatting updates

Change-Id: I7352bed0115b8fcdb4708e012d83e81d1ae494ed
(cherry picked from commit d80f5277e1c6a6043408244288effb08713c8d70)

3 years agoMerge "Gracefully degrade unsupported types with asyncpg" into rel_1_4
mike bayer [Wed, 3 Nov 2021 14:50:47 +0000 (14:50 +0000)] 
Merge "Gracefully degrade unsupported types with asyncpg" into rel_1_4

3 years agoMerge "Fixed issue in visit_on_duplicate_key_update within a composed expression...
mike bayer [Wed, 3 Nov 2021 14:49:40 +0000 (14:49 +0000)] 
Merge "Fixed issue in visit_on_duplicate_key_update within a composed expression" into rel_1_4

3 years agoGracefully degrade unsupported types with asyncpg
Gord Thompson [Tue, 2 Nov 2021 22:16:50 +0000 (16:16 -0600)] 
Gracefully degrade unsupported types with asyncpg

Fixes: #7284
Modify the on_connect() method of PGDialect_asyncpg to
gracefully degrade unsupported types instead of throwing a
ValueError. Useful for third-party dialects that derive
from PGDialect_asyncpg but whose databases do not support
all types (e.g., CockroachDB supports JSONB but not JSON).

Change-Id: Ibb7cc8c3de632d27b9716a93d83956a590b2a2b0
(cherry picked from commit 96c294da8a50d692b3f0b8e508dbbca5d9c22f1b)

3 years agoFixed issue in visit_on_duplicate_key_update within a composed expression
Cristian Sabaila [Wed, 3 Nov 2021 01:39:08 +0000 (21:39 -0400)] 
Fixed issue in visit_on_duplicate_key_update within a composed expression

Fixed issue in MySQL :meth:`_mysql.Insert.on_duplicate_key_update` which
would render the wrong column name when an expression were used in a VALUES
expression. Pull request courtesy Cristian Sabaila.

Fixes: #7281
Closes: #7285
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7285
Pull-request-sha: 3e6ad6f2fecc6ae36a10a5a34b5d3d393483edbb

Change-Id: I83377c20eae6358fead9e7e361127938e538a71c
(cherry picked from commit 5740a843ed805d0b066b1e56e8bf3c584c32cf6b)

3 years agomap Float to asyncpg.FLOAT, test for infinity
Mike Bayer [Tue, 2 Nov 2021 22:19:35 +0000 (18:19 -0400)] 
map Float to asyncpg.FLOAT, test for infinity

Fixes: #7283
Change-Id: I5402a72617b7f9bc366d64bc5ce8669374839984
(cherry picked from commit 9fa79bb53638e02aaa45d77397b39a1b652ba5f1)

3 years agoensure soft_close occurs for fetchmany with server side cursor
Mike Bayer [Tue, 2 Nov 2021 14:58:01 +0000 (10:58 -0400)] 
ensure soft_close occurs for fetchmany with server side cursor

Fixed regression where the :meth:`_engine.CursorResult.fetchmany` method
would fail to autoclose a server-side cursor (i.e. when ``stream_results``
or ``yield_per`` is in use, either Core or ORM oriented results) when the
results were fully exhausted.

All :class:`_result.Result` objects will now consistently raise
:class:`_exc.ResourceClosedError` if they are used after a hard close,
which includes the "hard close" that occurs after calling "single row or
value" methods like :meth:`_result.Result.first` and
:meth:`_result.Result.scalar`. This was already the behavior of the most
common class of result objects returned for Core statement executions, i.e.
those based on :class:`_engine.CursorResult`, so this behavior is not new.
However, the change has been extended to properly accommodate for the ORM
"filtering" result objects returned when using 2.0 style ORM queries,
which would previously behave in "soft closed" style of returning empty
results, or wouldn't actually "soft close" at all and would continue
yielding from the underlying cursor.

As part of this change, also added :meth:`_result.Result.close` to the base
:class:`_result.Result` class and implemented it for the filtered result
implementations that are used by the ORM, so that it is possible to call
the :meth:`_engine.CursorResult.close` method on the underlying
:class:`_engine.CursorResult` when the the ``yield_per`` execution option
is in use to close a server side cursor before remaining ORM results have
been fetched. This was again already available for Core result sets but the
change makes it available for 2.0 style ORM results as well.

Fixes: #7274
Change-Id: Id4acdfedbcab891582a7f8edd2e2e7d20d868e53
(cherry picked from commit 33824a9c06ca555ad208a9925bc7b40fe489fc72)

3 years agouse full context manager flow for future.Engine.begin()
Mike Bayer [Mon, 1 Nov 2021 20:36:51 +0000 (16:36 -0400)] 
use full context manager flow for future.Engine.begin()

Fixed issue in future :class:`_future.Engine` where calling upon
:meth:`_future.Engine.begin` and entering the context manager would not
close the connection if the actual BEGIN operation failed for some reason,
such as an event handler raising an exception; this use case failed to be
tested for the future version of the engine. Note that the "future" context
managers which handle ``begin()`` blocks in Core and ORM don't actually run
the "BEGIN" operation until the context managers are actually entered. This
is different from the legacy version which runs the "BEGIN" operation up
front.

Fixes: #7272
Change-Id: I9667ac0861a9e007c4b3dfcf0fcf0829038a8711
(cherry picked from commit c4abf5a44249fa42ae9c5d5c3035b8258c6d92b6)

3 years agoRevise "literal parameters" FAQ section
Mike Bayer [Mon, 1 Nov 2021 16:06:32 +0000 (12:06 -0400)] 
Revise "literal parameters" FAQ section

based on feedback in #7271, the emphasis on TypeDecorator
as a solution to this problem is not very practical.  illustrate
a series of quick recipes that are useful for debugging purposes
to print out a repr() or simple stringify of a parameter
without the need to construct custom dialects or types.

Change-Id: I788ce1b5ea01d88dd0a22d03d06f35aabff5e5c8
(cherry picked from commit b2a28c556f10ee31605c978173f0cce62175ad61)

3 years agoinit rel_1_4 branch
Mike Bayer [Sat, 30 Oct 2021 14:14:37 +0000 (10:14 -0400)] 
init rel_1_4 branch

Change-Id: I982c86c3f3cc4b1ed1956a9eb92cf4612535ae45

3 years agowarnings removal, merge_result
Mike Bayer [Fri, 29 Oct 2021 21:36:26 +0000 (17:36 -0400)] 
warnings removal, merge_result

this is the last warning to remove.

Also fixes some mistakes I made with the new
Base20DeprecationWarning and LegacyAPIWarning classes created,
where functions in deprecations.py were still hardcoded to
RemovedIn20Warning.

Change-Id: I9a6045ac9b813fd2f9668c4bc518c46a7774c6ef

3 years agoMerge "warnings: session.autocommit, subtransactions" into main
mike bayer [Fri, 29 Oct 2021 21:56:38 +0000 (21:56 +0000)] 
Merge "warnings: session.autocommit, subtransactions" into main

3 years agoclarify order_by(None) for Core; improve wording
Mike Bayer [Fri, 29 Oct 2021 21:53:12 +0000 (17:53 -0400)] 
clarify order_by(None) for Core; improve wording

the order_by(None) convention was documented for orm.Query
but not Core select.

Change-Id: I0c1ad76c3eefba1cb54b1649cfd09169c17e2bba

3 years agowarnings: session.autocommit, subtransactions
Mike Bayer [Fri, 29 Oct 2021 15:12:13 +0000 (11:12 -0400)] 
warnings: session.autocommit, subtransactions

Change-Id: I7eb7c87c9656f8043ea90d53897958afad2b8fe9

3 years agowarnings: with_polymorphic()
Mike Bayer [Fri, 29 Oct 2021 16:10:37 +0000 (12:10 -0400)] 
warnings: with_polymorphic()

Also clarifies a behavior of None/False for the selectable
parameter to with_polymorphic()

Fixes: #7262
Change-Id: I58c4004e0af227d3995e9ae2461470440f97f252

3 years agoMerge "Modernize tests - session_query_get" into main
mike bayer [Fri, 29 Oct 2021 14:22:41 +0000 (14:22 +0000)] 
Merge "Modernize tests - session_query_get" into main

3 years agoModernize tests - session_query_get
Gord Thompson [Thu, 30 Sep 2021 23:39:05 +0000 (17:39 -0600)] 
Modernize tests - session_query_get

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I92013aad471baf32df1b51b756e86d95449b5cfd