]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
3 years agodont transfer __weakref__ to regenerated class
Mike Bayer [Thu, 9 Jun 2022 13:53:43 +0000 (09:53 -0400)] 
dont transfer __weakref__ to regenerated class

Repaired a deprecation warning class decorator that was preventing key
objects such as :class:`_engine.Connection` from having a proper
``__weakref__`` attribute, causing operations like Python standard library
``inspect.getmembers()`` to fail.

Fixes: #8115
Change-Id: Ifd0bc2325fb9dc9e1431998c308b7fc081968373
(cherry picked from commit cc7cc3c9ec73055703acc78c8d92eb0242e5cd20)

3 years agoMerge "fix race conditions in lambda statements" into rel_1_4
mike bayer [Thu, 9 Jun 2022 12:37:27 +0000 (12:37 +0000)] 
Merge "fix race conditions in lambda statements" into rel_1_4

3 years agoMerge "suppport with_loader_criteria pickling w/ fixed callable" into rel_1_4
mike bayer [Thu, 9 Jun 2022 00:54:07 +0000 (00:54 +0000)] 
Merge "suppport with_loader_criteria pickling w/ fixed callable" into rel_1_4

3 years agoadd tests to confirm no issue w/ pg json keys
Mike Bayer [Wed, 8 Jun 2022 23:04:23 +0000 (19:04 -0400)] 
add tests to confirm no issue w/ pg json keys

Change-Id: Ie91e5efb217c309bc40c3933f538bcf29c1fd87b
References: #8112
(cherry picked from commit 409a2173ebe8a9126911051873b3734e6c6be3f4)

3 years agosuppport with_loader_criteria pickling w/ fixed callable
Mike Bayer [Wed, 8 Jun 2022 17:05:20 +0000 (13:05 -0400)] 
suppport with_loader_criteria pickling w/ fixed callable

Fixed issue where a :func:`_orm.with_loader_criteria` option could not be
pickled, as is necessary when it is carried along for propagation to lazy
loaders in conjunction with a caching scheme. Currently, the only form that
is supported as picklable is to pass the "where criteria" as a fixed
module-level callable function that produces a SQL expression. An ad-hoc
"lambda" can't be pickled, and a SQL expression object is usually not fully
picklable directly.

Fixes: #8109
Change-Id: I49fe69088b0c7e58a0f22c67d2ea4e33752a5a73
(cherry picked from commit 293b0e3dd8205185b84cd3baf2f078348437d245)

3 years agofix race conditions in lambda statements
Mike Bayer [Tue, 7 Jun 2022 19:00:20 +0000 (15:00 -0400)] 
fix race conditions in lambda statements

Fixed multiple observed race conditions related to :func:`.lambda_stmt`,
including an initial "dogpile" issue when a new Python code object is
initially analyzed among multiple simultaneous threads which created both a
performance issue as well as some internal corruption of state.
Additionally repaired observed race condition which could occur when
"cloning" an expression construct that is also in the process of being
compiled or otherwise accessed in a different thread due to memoized
attributes altering the ``__dict__`` while iterated, for Python versions
prior to 3.10; in particular the lambda SQL construct is sensitive to this
as it holds onto a single statement object persistently. The iteration has
been refined to use ``dict.copy()`` with or without an additional iteration
instead.

Fixes: #8098
Change-Id: I4e0b627bfa187f1780dc68ec81b94db1c78f846a
(cherry picked from commit 117878f7870377f143917a22160320a891eb0211)

3 years agodocument thread safety workaround for lambda statements
Mike Bayer [Wed, 8 Jun 2022 20:03:26 +0000 (16:03 -0400)] 
document thread safety workaround for lambda statements

Change-Id: Idb7840ff64487ef985087a28bb6e96088e6a392e
References: #8098
(cherry picked from commit bf40bade26e32fc3757bbd756f4c9ebdc5d72090)

3 years agoMerge "graceful degrade for FKs not reflectable" into rel_1_4
mike bayer [Wed, 8 Jun 2022 17:14:33 +0000 (17:14 +0000)] 
Merge "graceful degrade for FKs not reflectable" into rel_1_4

3 years agoadd note re: pickling for loader criteria
Mike Bayer [Wed, 8 Jun 2022 15:56:57 +0000 (11:56 -0400)] 
add note re: pickling for loader criteria

Change-Id: I75992af71ba08799a03995178a6e4612c9a7428a
References: #8108

3 years agograceful degrade for FKs not reflectable
Mike Bayer [Tue, 7 Jun 2022 13:40:26 +0000 (09:40 -0400)] 
graceful degrade for FKs not reflectable

Fixed bugs involving the :paramref:`.Table.include_columns` and the
:paramref:`.Table.resolve_fks` parameters on :class:`.Table`; these
little-used parameters were apparently not working for columns that refer
to foreign key constraints.

In the first case, not-included columns that refer to foreign keys would
still attempt to create a :class:`.ForeignKey` object, producing errors
when attempting to resolve the columns for the foreign key constraint
within reflection; foreign key constraints that refer to skipped columns
are now omitted from the table reflection process in the same way as
occurs for :class:`.Index` and :class:`.UniqueConstraint` objects with the
same conditions. No warning is produced however, as we likely want to
remove the include_columns warnings for all constraints in 2.0.

In the latter case, the production of table aliases or subqueries would
fail on an FK related table not found despite the presence of
``resolve_fks=False``; the logic has been repaired so that if a related
table is not found, the :class:`.ForeignKey` object is still proxied to the
aliased table or subquery (these :class:`.ForeignKey` objects are normally
used in the production of join conditions), but it is sent with a flag that
it's not resolvable. The aliased table / subquery will then work normally,
with the exception that it cannot be used to generate a join condition
automatically, as the foreign key information is missing. This was already
the behavior for such foreign key constraints produced using non-reflection
methods, such as joining :class:`.Table` objects from different
:class:`.MetaData` collections.

Fixes: #8100
Fixes: #8101
Change-Id: Ifa37a91bd1f1785fca85ef163eec031660d9ea4d
(cherry picked from commit 40e3c0da5be7dd526866bfc63590fc5621a9bd6e)

3 years agomigrate labels to new tutorial
Mike Bayer [Sat, 4 Jun 2022 19:53:34 +0000 (15:53 -0400)] 
migrate labels to new tutorial

other org changes and some sections from old tutorial
ported to new tutorial.

Change-Id: Ic0fba60ec82fff481890887beef9ed0fa271875a
(Cherry-picked and independently modified)

3 years agoDocs Update - Add **kwargs to CaseInsensitiveComparator docs (#8063)
Justin Crown [Sat, 4 Jun 2022 20:10:38 +0000 (16:10 -0400)] 
Docs Update - Add **kwargs to CaseInsensitiveComparator docs (#8063)

* Add **kwargs to CaseInsensitiveComparator docs

* add kwargs to other operate examples

Change-Id: I70a1e68bca27c2355ad3b7c5bbc538027f112bd9

* missed one entry

Change-Id: Ieb4a18ab6d96e588e9ec7672cfa65fe2fd8301e5

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
(cherry picked from commit 1508aed47261fe17180aa12fb312aebb0dd3c615)

3 years agoFixed orm not applying fetch
Federico Caselli [Fri, 3 Jun 2022 10:13:10 +0000 (12:13 +0200)] 
Fixed orm not applying fetch

Fixed an issue where :meth:`_sql.GenerativeSelect.fetch` would be
ignored when executing a statement using the ORM.

Fixes: #8091
Change-Id: I6790c7272a71278e90de2529c8bc8ae89e54e288
(cherry picked from commit 526e9bb6ae025d3b8032d6efc1deb1a0f4a3dae3)

3 years agoLink to dialect for Actian Avalanche, Vector, Actian X, and Ingres (#8039)
clach04 [Sat, 4 Jun 2022 10:15:17 +0000 (03:15 -0700)] 
Link to dialect for Actian Avalanche, Vector, Actian X, and Ingres (#8039)

(cherry picked from commit 7f20d506937a92019d2c44fd7804ed0f17d6a482)

3 years agodocs: spelling error (#8088)
Galen Rice [Sat, 4 Jun 2022 10:07:43 +0000 (06:07 -0400)] 
docs: spelling error (#8088)

Leave off the last S for savings!

(cherry picked from commit 424e9e621205c1186e8f9f5009fb35babec31c0e)

3 years agoemphasize expire_on_commit in detached error docs
Mike Bayer [Thu, 2 Jun 2022 18:52:27 +0000 (14:52 -0400)] 
emphasize expire_on_commit in detached error docs

issues like #8082 suggest users are still not
fully aware of the need to set this parameter
when dealing with detached objects.

Change-Id: I6f389fdbe18b9c977bfb8188fc4732dbd56884d9
(cherry picked from commit ad86d32f7fbd1c6deda8ff3bebe0595c0f2986cc)

3 years agopropagate proxy_key from WrapsColumnExpression
Mike Bayer [Wed, 1 Jun 2022 16:11:19 +0000 (12:11 -0400)] 
propagate proxy_key from WrapsColumnExpression

this allows cast() of a label() to propagate the
proxy key outwards in the same way that it apparently
works at the SQL level.

This is stuffing even more rules into naming so basically
seeing how far we can go without other cases starting
to fail.

Fixes: #8084
Change-Id: I20bd97dae798fee6492334c06934e807d0f269ef
(cherry picked from commit 14250f2668151f1c4df86dbf962c771e9788111e)

3 years agoVersion 1.4.38 placeholder
Mike Bayer [Tue, 31 May 2022 21:28:09 +0000 (17:28 -0400)] 
Version 1.4.38 placeholder

3 years ago- 1.4.37 rel_1_4_37
Mike Bayer [Tue, 31 May 2022 21:23:09 +0000 (17:23 -0400)] 
- 1.4.37

3 years agochangelog fixes
Mike Bayer [Tue, 31 May 2022 21:21:39 +0000 (17:21 -0400)] 
changelog fixes

Change-Id: Id3fc3019f8eb799aa5adf6ca28e0aeedc0da31dd
(cherry picked from commit 1e8e4ace63f93327e5c7e000acb6c0efb595eed1)

3 years agoMerge "Handle dead-connection errors for users of python-oracledb" into rel_1_4
mike bayer [Tue, 31 May 2022 20:42:41 +0000 (20:42 +0000)] 
Merge "Handle dead-connection errors for users of python-oracledb" into rel_1_4

3 years agoMerge "raise informative error when selectable can't be extended" into rel_1_4
mike bayer [Tue, 31 May 2022 19:48:15 +0000 (19:48 +0000)] 
Merge "raise informative error when selectable can't be extended" into rel_1_4

3 years agoUpdate declarative_styles.rst: Update code example to attrs TNG usage. (#8072)
Patrick Gerken [Tue, 31 May 2022 19:42:35 +0000 (21:42 +0200)] 
Update declarative_styles.rst: Update code example to attrs TNG usage. (#8072)

* Update declarative_styles.rst

Update docs to new style usage of attrs.
This is the default since December 2021.
While the old style still works, the newer one looks much nicer and is likely to be dominant pretty quickly. Imho.

* Update declarative_styles.rst

* Update declarative_styles.rst

(cherry picked from commit 1e1431fbfb4992f8d85d3fd42ec06975e7f762f0)

3 years agoraise informative error when selectable can't be extended
Mike Bayer [Tue, 31 May 2022 14:48:16 +0000 (10:48 -0400)] 
raise informative error when selectable can't be extended

An informative error is raised for the use case where
:meth:`.Insert.from_select` is being passed a "compound select" object such
as a UNION, yet the INSERT statement needs to append additional columns to
support Python-side or explicit SQL defaults from the table metadata. In
this case a subquery of the compound object should be passed.

Fixes: #8073
Change-Id: Ic4a5dbf84ec49d2451901be05cb9cf6ae93f02b7
(cherry picked from commit 7474df2159f89d684d32aabb15014ef95cea1641)

3 years agoHandle dead-connection errors for users of python-oracledb
Christopher Jones [Tue, 31 May 2022 12:27:18 +0000 (08:27 -0400)] 
Handle dead-connection errors for users of python-oracledb

Added two new error codes for Oracle disconnect handling to support early
testing of the new "python-oracledb" driver released by Oracle.

Fixes: #8066
Closes: #8065
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8065
Pull-request-sha: d630b8457a1d29b7a1354ccc6d5e2956eea865f6

Change-Id: Ib14dbb888597b1087b1bb7c505ccad59df226177
(cherry picked from commit 2bf00472bfafd8fd0cca5b4fe55ff4faf1a1279e)

3 years agorepair incorrect "cursor" var name in connection faq
Josep Pascual Badia [Mon, 30 May 2022 14:41:55 +0000 (10:41 -0400)] 
repair incorrect "cursor" var name in connection faq

Closes: #8075
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8075
Pull-request-sha: 34e5eaf3870f89c9c38ffe81121fa1b42e363752

Change-Id: Iab8cdc9f8da68ac955eea75efeba263d0a9dcb7b
(cherry picked from commit d97de97eff21af3bdacffc2b625feb7e0bd6c18c)

3 years agoMerge "remove "deannotate" from column_property expression" into rel_1_4
mike bayer [Sun, 29 May 2022 21:37:05 +0000 (21:37 +0000)] 
Merge "remove "deannotate" from column_property expression" into rel_1_4

3 years agoMerge "move bindparam quote application from compiler to default" into rel_1_4
mike bayer [Sun, 29 May 2022 21:35:00 +0000 (21:35 +0000)] 
Merge "move bindparam quote application from compiler to default" into rel_1_4

3 years agoremove "deannotate" from column_property expression
Mike Bayer [Fri, 27 May 2022 20:07:01 +0000 (16:07 -0400)] 
remove "deannotate" from column_property expression

Fixed issue where using a :func:`_orm.column_property` construct containing
a subquery against an already-mapped column attribute would not correctly
apply ORM-compilation behaviors to the subquery, including that the "IN"
expression added for a single-table inherits expression would fail to be
included.

This fix involves a few tweaks in the ORM adaptation logic,
including a missing "parententity" adaptation on the mapper
side.  The specific mechanics here have a lot of moving parts
so we will continue to add tests to assert these cases.  In
particular a more complete test for issue #2316 is added
that was relying upon the deannotate happening here.

Fixes: #8064
Change-Id: Ia85dd12dcf6e7c002b30de4a27d7aa66cb3cd20e
(cherry picked from commit 8c5cc8ae255a7580e2ff339659cf66cd2c6e02c1)

3 years agomove bindparam quote application from compiler to default
Mike Bayer [Sun, 29 May 2022 16:07:46 +0000 (12:07 -0400)] 
move bindparam quote application from compiler to default

in 296c84313ab29bf9599634f3 for #5653 we generalized Oracle's
parameter escaping feature into the compiler, so that it could also
work for PostgreSQL.  The compiler used quoted names within parameter
dictionaries, which then led to the complexity that all functions
which interpreted keys from the compiled_params dict had to
also quote the param names to use the dictionary.  This
extra complexity was not added to the ORM peristence.py however,
which led to the versioning id feature being broken as well as
other areas where persistence.py relies on naming schemes present
in context.compiled_params.  It also was not added to the
"processors" lookup which led to #8053, that added this escaping
to that part of the compiler.

To both solve the whole problem as well as simplify the compiler
quite a bit, move the actual application of the escaped names
to be as late as possible, when default.py builds the final list
of parameters.  This is more similar to how it worked previously
where OracleExecutionContext would be late-applying these
escaped names.   This re-establishes context.compiled_params as
deterministically named regardless of dialect in use and moves
out the complexity of the quoted param names to be only at the
cursor.execute stage.

Fixed bug, likely a regression from 1.3, where usage of column names that
require bound parameter escaping, more concretely when using Oracle with
column names that require quoting such as those that start with an
underscore, or in less common cases with some PostgreSQL drivers when using
column names that contain percent signs, would cause the ORM versioning
feature to not work correctly if the versioning column itself had such a
name, as the ORM assumes certain bound parameter naming conventions that
were being interfered with via the quotes. This issue is related to
:ticket:`8053` and essentially revises the approach towards fixing this,
revising the original issue :ticket:`5653` that created the initial
implementation for generalized bound-parameter name quoting.

Fixes: #8056
Change-Id: I57b064e8f0d070e328b65789c30076f6a0ca0fef
(cherry picked from commit a48b597d0cafa1dd7fc46be99eb808fd4cb0a347)

3 years agomssql login failure if password starts with "{"
Gord Thompson [Sun, 29 May 2022 13:07:45 +0000 (07:07 -0600)] 
mssql login failure if password starts with "{"

Fix issue where a password with a leading "{" would
result in login failure.

Fixes: #8062
Change-Id: If91c2c211937b5eac89b8d525c22a19b0a94c5c4
(cherry picked from commit 8ac7cb92b4972a08b8008b80b34989694510139f)

3 years agoMerge "apply bindparam escape name to processors dictionary" into rel_1_4
mike bayer [Wed, 25 May 2022 16:45:49 +0000 (16:45 +0000)] 
Merge "apply bindparam escape name to processors dictionary" into rel_1_4

3 years agoMerge "enable pg8000 for 1.29.1 and above" into rel_1_4
mike bayer [Wed, 25 May 2022 14:13:18 +0000 (14:13 +0000)] 
Merge "enable pg8000 for 1.29.1 and above" into rel_1_4

3 years agoapply bindparam escape name to processors dictionary
Mike Bayer [Wed, 25 May 2022 12:47:29 +0000 (08:47 -0400)] 
apply bindparam escape name to processors dictionary

Fixed SQL compiler issue where the "bind processing" function for a bound
parameter would not be correctly applied to a bound value if the bound
parameter's name were "escaped". Concretely, this applies, among other
cases, to Oracle when a :class:`.Column` has a name that itself requires
quoting, such that the quoting-required name is then used for the bound
parameters generated within DML statements, and the datatype in use
requires bind processing, such as the :class:`.Enum` datatype.

Fixes: #8053
Change-Id: I39d060a87e240b4ebcfccaa9c535e971b7255d99
(cherry picked from commit 4d58ca05e83048e999059a8c2c2e67cb77abf976)

3 years agoenable pg8000 for 1.29.1 and above
Mike Bayer [Mon, 23 May 2022 14:34:32 +0000 (10:34 -0400)] 
enable pg8000 for 1.29.1 and above

ROLLBACK TO SAVEPOINT is re-enabled
in https://github.com/tlocke/pg8000/issues/111.

we still have to add savepoint support to our fixture that
deletes from tables without checking for them.
this is inconvenient but not incorrect.

Change-Id: I2f4a0a3e18db93c3e6794ade9b0fee33d2e4b7dc
(cherry picked from commit c0612f8166b7cd07895e7302bb59192abbb68c43)

3 years agouse random table name
Mike Bayer [Tue, 24 May 2022 16:27:59 +0000 (12:27 -0400)] 
use random table name

this test is failing on CI with "##foo does not exist",
so hypothesize there's some kind of race condition with
global temp table names.

Change-Id: I8c6c26a7fda70f67735ce20af67373c311e48731
(cherry picked from commit d7b131d2dfc4c519b23d9ed29364036ef88b1863)

3 years agoMerge "Add a note on using server_onupdate=FetchedValue()" into rel_1_4
mike bayer [Mon, 23 May 2022 13:50:37 +0000 (13:50 +0000)] 
Merge "Add a note on using server_onupdate=FetchedValue()" into rel_1_4

3 years agoremove insanely old note from 12 years ago
Mike Bayer [Mon, 23 May 2022 13:48:05 +0000 (09:48 -0400)] 
remove insanely old note from 12 years ago

Change-Id: Id0929b6bc062fc4766c9c69427524e3cd2da1030
(cherry picked from commit 853f726454cff2f34c010cbafacfec85f51f8eeb)

3 years agoFormat code in documentation
Doctor [Sun, 22 May 2022 20:05:25 +0000 (16:05 -0400)] 
Format code in documentation

Closes: #7959
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7959
Pull-request-sha: fd8f60fcfe9cda0c2ba6dc9ddd171bf85a180295

Change-Id: I9a96c6e3e56cfd550672db4c1da4d68a961f970a
(cherry picked from commit eea04615536215a4651ed0c9877cf40d7bc7c12e)

3 years agoAdd a note on using server_onupdate=FetchedValue()
Andrew Brookins [Sun, 22 May 2022 20:24:15 +0000 (16:24 -0400)] 
Add a note on using server_onupdate=FetchedValue()

Add a note on using `server_onupdate=FetchedValue()` when using SQL expressions with `onupdate`.

My team encountered an issue with using a SQL expression with `onupdate`.
Despite the dialect (PG) supporting `RETURNING`, we needed to mark the column with
`server_onupdate=FetchedValue()` in order to get the column used with `onupdate`
to appear in the `RETURNING` clause of `UPDATE` statements.

This was not clear from the documentation, so I want to make it crystal clear for other
folks defining similar columns.

Closes: #7437
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7437
Pull-request-sha: 4845fb09a90ab58f0ae882e0d335ddba09b32ca0

Change-Id: I272278830c8f3f42d057ff77c3209e87df7adf02
(cherry picked from commit 0487cd1678458b786d4beca5ae3a9c8e343c3763)

3 years agoblock pg8000 >=1.29
Mike Bayer [Sun, 22 May 2022 14:19:18 +0000 (10:19 -0400)] 
block pg8000 >=1.29

Issue at https://github.com/tlocke/pg8000/issues/111
prevents savepoints from being usable.

Change-Id: Ic689cf065c47aea5a146d30c47eb9bbfe8375692
(cherry picked from commit 8ec93170d1434ca7e2a1506a3c962d40b8658183)

3 years agoUse collation in reflection in MSSQL
Federico Caselli [Wed, 18 May 2022 20:20:01 +0000 (22:20 +0200)] 
Use collation in reflection in MSSQL

Explicitly specify the collation when reflecting table columns using
MSSQL to prevent "collation conflict" errors.

Fixes: #8035
Change-Id: I4239a5ca8b041f56d7b3bba67b3357c176db31ee
(cherry picked from commit 5e54d5f1ad022781f5d8c6c7da4802613050dde5)

3 years agoMerge "Include new MySQL error code 4031 for MySQL disconnect check" into rel_1_4
mike bayer [Thu, 19 May 2022 14:56:00 +0000 (14:56 +0000)] 
Merge "Include new MySQL error code 4031 for MySQL disconnect check" into rel_1_4

3 years agoMerge "favor bool_op over op in comparison" into rel_1_4
mike bayer [Thu, 19 May 2022 14:05:11 +0000 (14:05 +0000)] 
Merge "favor bool_op over op in comparison" into rel_1_4

3 years agoInclude new MySQL error code 4031 for MySQL disconnect check
valievkarim [Wed, 18 May 2022 20:24:41 +0000 (16:24 -0400)] 
Include new MySQL error code 4031 for MySQL disconnect check

Added disconnect code for MySQL error 4031, introduced in MySQL >= 8.0.24,
indicating connection idle timeout exceeded. In particular this repairs an
issue where pre-ping could not reconnect on a timed-out connection. Pull
request courtesy valievkarim.

Fixes: #8036
Closes: #8037
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8037
Pull-request-sha: 7ab605c2d25c3cd83af41e3250c97c623220cc7a

Change-Id: I21249c9d8acb305ac43ce61b90b41daf7fabdfe8
(cherry picked from commit de399c914b923ec3c81d3a51e16c7b720d34e058)

3 years agofavor bool_op over op in comparison
Mike Bayer [Wed, 18 May 2022 20:21:49 +0000 (16:21 -0400)] 
favor bool_op over op in comparison

there's no need to use the is_comparison parameter
anymore as bool_op() works better and in 2.0 also does
typing correctly.

Change-Id: I9e92b665b112d40d90e539003b0efe00ed7b075f
(cherry picked from commit deb9bcc0d97dd8b38dfccb340a5fc1f880202ff6)

3 years agoUpdate dbapi_transactions.rst (#8032)
Robert Kulagowski [Wed, 18 May 2022 20:25:18 +0000 (15:25 -0500)] 
Update dbapi_transactions.rst (#8032)

If you're defining 'y=row.y' then you might as well use 'y' in the print statement.

(cherry picked from commit b66d57451ad28572c000490c10e451cbf600a9d1)

3 years agofix most sphinx warnings
Mike Bayer [Mon, 16 May 2022 14:57:51 +0000 (10:57 -0400)] 
fix most sphinx warnings

still can't figure out the warnings with some of the older
changelog files.

Fixes: #7946
Change-Id: Id657ab23008eed0b133fed65b2f9ea75a626215c

3 years agoMerge "render col name in on conflict set clause, not given key" into rel_1_4
mike bayer [Sun, 15 May 2022 23:27:59 +0000 (23:27 +0000)] 
Merge "render col name in on conflict set clause, not given key" into rel_1_4

3 years agorender col name in on conflict set clause, not given key
Mike Bayer [Fri, 13 May 2022 20:08:34 +0000 (16:08 -0400)] 
render col name in on conflict set clause, not given key

Fixed bug where the PostgreSQL :meth:`_postgresql.Insert.on_conflict`
method and the SQLite :meth:`_sqlite.Insert.on_conflict` method would both
fail to correctly accommodate a column with a separate ".key" when
specifying the column using its key name in the dictionary passed to
``set_``, as well as if the :attr:`_sqlite.Insert.excluded` or
:attr:`_postgresql.Insert.excluded` collection were used as the dictionary
directly.

Fixes: #8014
Change-Id: I67226aeedcb2c683e22405af64720cc1f990f274
(cherry picked from commit 927abc3b33f10464ed04db3d7a454faeb6e729f2)

3 years agoraise for same param name in expanding + non expanding
Mike Bayer [Fri, 13 May 2022 19:43:53 +0000 (15:43 -0400)] 
raise for same param name in expanding + non expanding

An informative error is raised if two individual :class:`.BindParameter`
objects share the same name, yet one is used within an "expanding" context
(typically an IN expression) and the other is not; mixing the same name in
these two different styles of usage is not supported and typically the
``expanding=True`` parameter should be set on the parameters that are to
receive list values outside of IN expressions (where ``expanding`` is set
by default).

Fixes: #8018
Change-Id: Ie707f29680eea16b9e421af93560ac1958e11a54
(cherry picked from commit f9fccdeeb6749d10aeec458f1a549906d58ddad8)

3 years agoadjust log stacklevel for py3.11.0b1; enable greenlet
Mike Bayer [Sat, 14 May 2022 14:25:53 +0000 (10:25 -0400)] 
adjust log stacklevel for py3.11.0b1; enable greenlet

Fixed issue where support for logging "stacklevel" implemented in
:ticket:`7612` required adjustment to work with recently released Python
3.11.0b1, also repairs the unit tests which tested this feature.

Install greenlet from a py311 compat patch.

re: the stacklevel thing, this is going to be very inconvenient
if we have to keep hardcoding numbers everywhere for every
new python version

Change-Id: I0c8f7293e98c0ca5cc544538284bfd1d3020cb1f
References: https://github.com/python-greenlet/greenlet/issues/288
Fixes: #8019
(cherry picked from commit 43ff5b82dc0d91cacd625ac8943622ab340958c5)

3 years agoRevert "search for pickle failures"
Mike Bayer [Fri, 13 May 2022 14:53:07 +0000 (10:53 -0400)] 
Revert "search for pickle failures"

This reverts commit 48ccecbe69795753baac1ca6d351c1af5ebcdd7b.

not being careful w/ the commandline as I eat breakfast today

3 years agomore expire_on_commit reminders
Mike Bayer [Fri, 13 May 2022 14:25:37 +0000 (10:25 -0400)] 
more expire_on_commit reminders

the session commit/close docs still feel awkward in how
one learns about this operation.   hopefully another pass
over 2.0 can make things more linear.

removed a 1.4 note about autobegin that was completely inaccurate;
commit() does autobegin so it has an effect, just not usually
on the database.

Change-Id: Iaa4b96bd3df6cf82e851b2943322ddad7abbbac0
(cherry picked from commit cd628fad7c92f5f54bf1bf6985fd983269b0ec19)

3 years agosearch for pickle failures
Mike Bayer [Fri, 13 May 2022 13:24:09 +0000 (09:24 -0400)] 
search for pickle failures

this is not for merge, trying to locate what might be
the problem at #8000

Change-Id: I3ee7bf85f42eca861d32fc402b69796d518934d1

3 years agobump zimports to 0.6.0
Mike Bayer [Tue, 10 May 2022 14:32:18 +0000 (10:32 -0400)] 
bump zimports to 0.6.0

new multiprocessing support

Change-Id: I165a419a67c4e4a5e49d15cf2ac5c8aa46d16cbc
(cherry picked from commit 9294ac7fe02eb2f8aad78122eae199192f12ef52)

3 years agodont use the label convention for memoized entities
Mike Bayer [Mon, 9 May 2022 14:27:51 +0000 (10:27 -0400)] 
dont use the label convention for memoized entities

Fixed issue where ORM results would apply incorrect key names to the
returned :class:`.Row` objects in the case where the set of columns to be
selected were changed, such as when using
:meth:`.Select.with_only_columns`.

Fixes: #8001
Change-Id: If3a2a5d00d15ebc2e9d41494845cfb3b06f80dcc
(cherry picked from commit 319f09ffced3f655e7d500b3a9965e19468fd9d9)

3 years agoUse tuple instead of raw url in string formatting (#7987)
dzcode [Tue, 3 May 2022 20:18:43 +0000 (14:18 -0600)] 
Use tuple instead of raw url in string formatting (#7987)

* Fixes: #7902 - Use tuple instead of raw url in string formatting

* Fix lint error

(cherry picked from commit 675c3e17f7fcccb7534c46adb56529fc3ddd8dbf)

3 years agodocs(types) Fix missing import from sqlalchemy (#7978)
khashashin [Tue, 3 May 2022 20:00:59 +0000 (22:00 +0200)] 
docs(types) Fix missing import from sqlalchemy (#7978)

* docs(types) Fix missing import from sqlalchemy

The sample code is missing the import of Enum from sqlalchemy, which might confuse the reader, since we are using another enum type from Python itself here. So it makes sense to clarify that here.

* fix whitespaces

Change-Id: I019bbed8a7278f60e7239160ea4c99ecd2519d3b

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
(cherry picked from commit f89a202d60215b13e3733a3ea950473962b3cf67)

3 years agobypass pyodbc default server version / set charset
Mike Bayer [Tue, 3 May 2022 12:58:27 +0000 (08:58 -0400)] 
bypass pyodbc default server version / set charset

Further adjustments to the MySQL PyODBC dialect to allow for complete
connectivity, which was previously still not working despite fixes in
:ticket:`7871`.

Fixes: #7966
Change-Id: I549ea9e7b6e722e22d3e25bdb2fe0934603e2454
(cherry picked from commit 4abca61b4903e42f9568cc06f3c18ac27a139cf7)

3 years agouse bindparam_type in BinaryElementImpl._post_coercion if available
Mike Bayer [Sun, 1 May 2022 16:28:36 +0000 (12:28 -0400)] 
use bindparam_type in BinaryElementImpl._post_coercion if available

Fixed an issue where using :func:`.bindparam` with no explicit data or type
given could be coerced into the incorrect type when used in expressions
such as when using :meth:`.ARRAY.comparator.any` and
:meth:`.ARRAY.comparator.all`.

Fixes: #7979
Change-Id: If7779e713c9a3a5fee496b66e417cfd3fca5b1f9
(cherry picked from commit 889cbe53121c8fd50c845357dd52b24594346b68)

3 years agoVersion 1.4.37 placeholder
Mike Bayer [Tue, 26 Apr 2022 21:12:08 +0000 (17:12 -0400)] 
Version 1.4.37 placeholder

3 years ago- 1.4.36 rel_1_4_36
Mike Bayer [Tue, 26 Apr 2022 20:56:04 +0000 (16:56 -0400)] 
- 1.4.36

3 years agoMerge "repair fetch_setting call in mysql pyodbc dialect" into rel_1_4
mike bayer [Tue, 26 Apr 2022 20:52:17 +0000 (20:52 +0000)] 
Merge "repair fetch_setting call in mysql pyodbc dialect" into rel_1_4

3 years agochangelog edits for 1.4.36
Mike Bayer [Tue, 26 Apr 2022 19:32:30 +0000 (15:32 -0400)] 
changelog edits for 1.4.36

Change-Id: I0dd6b8ace355e4884b918484ae7b2c7a8319ff7e

3 years agorepair fetch_setting call in mysql pyodbc dialect
Mike Bayer [Tue, 26 Apr 2022 19:02:37 +0000 (15:02 -0400)] 
repair fetch_setting call in mysql pyodbc dialect

Fixed a regression in the untested MySQL PyODBC dialect caused by the fix
for :ticket:`7518` in version 1.4.32 where an argument was being propagated
incorrectly upon first connect, leading to a ``TypeError``.

Fixes: #7871
Change-Id: I37f8ca8e83cb352ee2a2336b52863858259b1d77
(cherry picked from commit 3deff88fe12adc470792f71da7b9c54a5438638f)

3 years agobackport 6f02d5edd88fe247 to 1.4
Mike Bayer [Sun, 24 Apr 2022 20:19:16 +0000 (16:19 -0400)] 
backport 6f02d5edd88fe247 to 1.4

in 6f02d5edd88fe2475629438b0730181a2b00c5fe some cleanup
to ForeignKey repaired the use case of ForeignKey objects
referring to table name alone, by adding more robust
column resolution logic.  This change also fixes an issue
where the "referred column" naming convention key uses the
resolved referred column earlier than usual when a
ForeignKey is setting up its constraint.

Fixed bug where :class:`.ForeignKeyConstraint` naming conventions using the
``referred_column_0`` naming convention key would not work if the foreign
key constraint were set up as a :class:`.ForeignKey` object rather than an
explicit :class:`.ForeignKeyConstraint` object. As this change makes use of
a backport of some fixes from version 2.0, an additional little-known
feature that has likely been broken for many years is also fixed which is
that a :class:`.ForeignKey` object may refer to a referred table by name of
the table alone without using a column name, if the name of the referent
column is the same as that of the referred column.

The ``referred_column_0`` naming convention key was not previously not
tested with the :class:`.ForeignKey` object, only
:class:`.ForeignKeyConstraint`, and this bug reveals that the feature has
never worked correctly unless :class:`.ForeignKeyConstraint` is used for
all FK constraints. This bug traces back to the original introduction of
the feature introduced for :ticket:`3989`.

Fixes: #7958
Change-Id: I230d43e9deba5dff889b9e7fee6cd4d3aa2496d3

3 years agoMerge "properly type array element in any() / all()" into rel_1_4
mike bayer [Sat, 23 Apr 2022 04:08:26 +0000 (04:08 +0000)] 
Merge "properly type array element in any() / all()" into rel_1_4

3 years agoproperly type array element in any() / all()
Mike Bayer [Fri, 22 Apr 2022 14:57:00 +0000 (10:57 -0400)] 
properly type array element in any() / all()

Fixed bug in :class:`.ARRAY` datatype in combination with :class:`.Enum` on
PostgreSQL where using the ``.any()`` method to render SQL ANY(), given
members of the Python enumeration as arguments, would produce a type
adaptation failure on all drivers.

Fixes: #6515
Change-Id: Ia1e3b4e10aaf264ed436ce6030d105fc60023433
(cherry picked from commit d023c8e1c7ad82fb249fab5155eb83dee17a160c)

3 years agofix memory leak in resultproxy.c
Mike Bayer [Fri, 22 Apr 2022 14:27:38 +0000 (10:27 -0400)] 
fix memory leak in resultproxy.c

the error raised for non-existent attribute didn't free
the "name" string, causing a leak.

Fixed a memory leak in the C extensions which could occur when calling upon
named members of :class:`.Row` when the member does not exist under Python
3; in particular this could occur during numpy transformations when it
attempts to call members such as ``.__array__``, but the issue was
surrounding any ``AttributeError`` thrown by the :class:`.Row` object. This
issue does not apply to version 2.0 which has already transitioned to
Cython. Thanks much to Sebastian Berg for identifying the problem.

Fixes: #7875
Change-Id: I444026a877ea1473a5ffac592c7f36ed6f4b563e

3 years agowarn for result.columns() method
Mike Bayer [Thu, 21 Apr 2022 17:27:16 +0000 (13:27 -0400)] 
warn for result.columns() method

A warning is emitted when calling upon the :meth:`.Result.columns` method
with only one index, in particular ORM related cases, indicating that the
current behavior of :meth:`.Result.columns` is broken in this case and
will be changed in 2.0.  To receive a collection of scalar values,
use the :meth:`.Result.scalars` method.

Fixes: #7953
Change-Id: I3c4ca3eecc2bfc85ad1c38000e5990d6dde80d22
(cherry picked from commit fe2045fb1c767436ed1e32359fe005dabead504a)

3 years agoImplement UUID.python_type
Alex Grönholm [Mon, 18 Apr 2022 17:07:19 +0000 (13:07 -0400)] 
Implement UUID.python_type

Implemented :attr:`_postgresql.UUID.python_type` attribute for the
:class:`_postgresql.UUID` type object. The attribute will return either
``str`` or ``uuid.UUID`` based on the :paramref:`_postgresql.UUID.as_uuid`
parameter setting. Previously, this attribute was unimplemented. Pull
request courtesy Alex Grönholm.

Fixes: #7943
Closes: #7944
Change-Id: Ic4fbaeee134d586b08339801968e787cc7e14285
(cherry picked from commit 408c936c77c6aaeceab0e0b001ed745ceb9d19d4)

3 years agoMerge "Allow contextvars to be set in events when using asyncio" into rel_1_4
mike bayer [Thu, 21 Apr 2022 13:44:45 +0000 (13:44 +0000)] 
Merge "Allow contextvars to be set in events when using asyncio" into rel_1_4

3 years agoFixes minor typo (#7950)
Alex Marvin [Wed, 20 Apr 2022 20:31:38 +0000 (16:31 -0400)] 
Fixes minor typo (#7950)

(cherry picked from commit 8ee0bf9e373fe98af38babcbc97435c3b505d09f)

3 years agoupdate ORM join doc
Mike Bayer [Tue, 19 Apr 2022 03:12:31 +0000 (23:12 -0400)] 
update ORM join doc

forgot to remove string support for the ON clause here.
will backport a deprecation message to 1.4.

Change-Id: If90e2bff929cce4dc8a6e9bd3ad818b8f8e514a6
(cherry picked from commit 13a8552053c21a9fa7ff6f992ed49ee92cca73e4)

3 years agoAllow contextvars to be set in events when using asyncio
Federico Caselli [Thu, 14 Apr 2022 22:29:01 +0000 (00:29 +0200)] 
Allow contextvars to be set in events when using asyncio

Allow setting contextvar values inside async adapted event handlers.
Previously the value set to the contextvar would not be properly
propagated.

Fixes: #7937
Change-Id: I787aa869f8d057579e13e32c749f05f184ffd02a
(cherry picked from commit 640d163bd8bf61e87790255558b6f704a0d06174)

3 years agoadapt_from_selectables is a set
Mike Bayer [Sat, 16 Apr 2022 15:40:13 +0000 (11:40 -0400)] 
adapt_from_selectables is a set

aliasedclass setting this as a list, making all the containment
checks more expensive.

the presence of the collection also serves as a flag so it
has to stay optional.

Change-Id: Iafffbeb29d77441ca35ecd8048244ee6eed1232c
(cherry picked from commit c538f810bce57472c8960a0a6c4c61024b00f3ed)

3 years agoupdate bake_queries documentation
Mike Bayer [Fri, 15 Apr 2022 15:11:42 +0000 (11:11 -0400)] 
update bake_queries documentation

this parameter has had no effect since 1.4.23 in #6889,
but the documentation was not updated.

Change-Id: I36f4ea6144b9fd09243f96698e7a03cd217da1e7

3 years agoFix link to RFC 1738 (#7935)
Sergey Golitsynskiy [Thu, 14 Apr 2022 20:01:26 +0000 (16:01 -0400)] 
Fix link to RFC 1738 (#7935)

3 years agoEnsure ORMInsert sets up bind state
Mike Bayer [Thu, 14 Apr 2022 16:01:16 +0000 (12:01 -0400)] 
Ensure ORMInsert sets up bind state

Fixed regression where the change in #7861, released in version 1.4.33,
that brought the :class:`.Insert` construct to be partially recognized as
an ORM-enabled statement did not properly transfer the correct mapper /
mapped table state to the :class:`.Session`, causing the
:meth:`.Session.get_bind` method to fail for a :class:`.Session` that was
bound to engines and/or connections using the :paramref:`.Session.binds`
parameter.

Fixes: #7936
Change-Id: If19edef8e2dd68335465429eb3d2f0bfdade4a4c
(cherry picked from commit 4f96c12db923624204110e56ce730f5aafbb9463)

3 years agoupdate Numeric/Float docstrings
Mike Bayer [Thu, 14 Apr 2022 13:59:11 +0000 (09:59 -0400)] 
update Numeric/Float docstrings

These docs were very out of date re: cdecimal.   Additionally,
as pointed out in #5252, the Numeric documentation is misleading;
SQLAlchemy's Numeric hierarchy resembles more of the Oracle
approach where precision and scale solely determine the kind of
datatype being worked with.   Float is essentially Numeric with
different defaults.

Fixes: #5252
Change-Id: I661109fabf04ba7831c7ddafba15321dd445ea5d
(cherry picked from commit 3d300066e8b20a89e0b82bf09dd0c4016f5f8e51)

3 years agoMerge "Fix psycopg2 pre_ping with autocommit" into rel_1_4
mike bayer [Wed, 13 Apr 2022 21:23:58 +0000 (21:23 +0000)] 
Merge "Fix psycopg2 pre_ping with autocommit" into rel_1_4

3 years agoFix psycopg2 pre_ping with autocommit
Federico Caselli [Mon, 11 Apr 2022 21:19:16 +0000 (23:19 +0200)] 
Fix psycopg2 pre_ping with autocommit

Fixed an issue what would cause autocommit mode to be reset
when using pre_ping in conjunction engine level autocommit
on the psycopg2 driver.

Fixes: #7930
Change-Id: I4cccaf1b7f8cbacd853689458080784114fcc390
(cherry picked from commit 363b68e08e9ceed4ce6821f5fd48ab32bdfd807c)

3 years agoread from cls.__dict__ so init_subclass works
Mike Bayer [Mon, 4 Apr 2022 23:01:54 +0000 (19:01 -0400)] 
read from cls.__dict__ so init_subclass works

Modified the :class:`.DeclarativeMeta` metaclass to pass ``cls.__dict__``
into the declarative scanning process to look for attributes, rather than
the separate dictionary passed to the type's ``__init__()`` method. This
allows user-defined base classes that add attributes within an
``__init_subclass__()`` to work as expected, as ``__init_subclass__()`` can
only affect the ``cls.__dict__`` itself and not the other dictionary. This
is technically a regression from 1.3 where ``__dict__`` was being used.

Additionally makes the reference between ClassManager and
the declarative configuration object a weak reference, so that it
can be discarded after mappers are set up.

Fixes: #7900
Change-Id: I3c2fd4e227cc1891aa4bb3d7d5b43d5686f9f27c
(cherry picked from commit 428ea01f00a9cc7f85e435018565eb6da7af1b77)

3 years agorepair ancient and incorrect comment
Mike Bayer [Tue, 12 Apr 2022 02:03:28 +0000 (22:03 -0400)] 
repair ancient and incorrect comment

it referred towards _columntoproperty refering to
lists of MapperProperty.  this comment goes all the
way to pre 0.1 being released.   it's likely been
wrong for nearly all that time.

Change-Id: I71234ae58a6253249d92224356e38372e4aff148
(cherry picked from commit 8254e3a28a32b7097fb926a373c17c35d4ec1d57)

3 years agoupdate flake8 noqa skips with proper syntax
Federico Caselli [Mon, 11 Apr 2022 20:21:20 +0000 (22:21 +0200)] 
update flake8 noqa skips with proper syntax

Change-Id: I42ed77f559e3ee5b8c600d98457ee37803ef0ea6
(cherry picked from commit 139c6ec0fb1f930be9b64545262d2580f6cbc83e)

3 years agoMerge "add sane_rowcount to SimpleUpdateDeleteTest" into rel_1_4
mike bayer [Sat, 9 Apr 2022 14:21:37 +0000 (14:21 +0000)] 
Merge "add sane_rowcount to SimpleUpdateDeleteTest" into rel_1_4

3 years agoupdate DDL examples removing execute_if
Mike Bayer [Sat, 9 Apr 2022 14:02:35 +0000 (10:02 -0400)] 
update DDL examples removing execute_if

Fixes: #7924
Change-Id: I684bf3720010ffe34dbdd39ec8c7e0c4af94e620
(cherry picked from commit 1eeded1687aef3132b2a1d5995321fb20b2b8dfc)

3 years agoadd sane_rowcount to SimpleUpdateDeleteTest
Mike Bayer [Sat, 9 Apr 2022 13:50:18 +0000 (09:50 -0400)] 
add sane_rowcount to SimpleUpdateDeleteTest

For third party dialects, repaired a missing requirement for the
``SimpleUpdateDeleteTest`` suite test which was not checking for a working
"rowcount" function on the target dialect.

Fixes: #7919
Change-Id: I2bc68132131eb36c43b8dabec0fac86272e26df5
(cherry picked from commit f3a65eb9033397fbf746fbf71df19ca9d1fce2f4)

3 years agoi forgot about begin_nested()
Mike Bayer [Fri, 8 Apr 2022 14:56:54 +0000 (10:56 -0400)] 
i forgot about begin_nested()

make bulleted lists of what is autoflush and what's not.

Change-Id: Id3bc4714013e9df243d804d7b5b60c6ef75e1316
(cherry picked from commit 4acf50c8e86b6b047853b2bc96ccaa494811085f)

3 years agoclarify autoflush setting does not apply to commit
Mike Bayer [Fri, 8 Apr 2022 14:36:50 +0000 (10:36 -0400)] 
clarify autoflush setting does not apply to commit

Change-Id: Icad0f3bd071422b8d1af204c9a1193a9ce6124ba
References: #7916
(cherry picked from commit ed2b29dc344c9cb65745c767b755f82d913695b8)

3 years agoexplicitly refer to Apple M1 for greenlet issue
Mike Bayer [Fri, 8 Apr 2022 13:28:47 +0000 (09:28 -0400)] 
explicitly refer to Apple M1 for greenlet issue

As developers are now buying lots of Apple M1
machines, and AFAWK greenlet is still not able
to provide a pre-built wheel, we are going to get a lot
of devs trying to use asyncio on their Apple M1s, in
greater proportions compared to devs running containers
etc. on other various less popular CPU architectures.

Add a new FAQ section for installation, add new
red dragon to the very top of asyncio docs,
add new verbiage, all of which includes
"Apple M1" in bold text, to minimize the chance of anyone
missing this.

Fixes: #7922
Fixes: #7714
Change-Id: I106923a2860a4efd77d1b999197be102afc1f73d
(cherry picked from commit f7ebfa6072d65c32c61194b265662c957d3f09dd)

3 years agoVersion 1.4.36 placeholder
Mike Bayer [Wed, 6 Apr 2022 15:34:25 +0000 (11:34 -0400)] 
Version 1.4.36 placeholder

3 years ago- 1.4.35 rel_1_4_35
Mike Bayer [Wed, 6 Apr 2022 15:23:05 +0000 (11:23 -0400)] 
- 1.4.35

3 years agoclassify issue
Mike Bayer [Wed, 6 Apr 2022 15:17:05 +0000 (11:17 -0400)] 
classify issue

Change-Id: Id1e59fee382d1d72d78e99b1c56a5837b5503fed
(cherry picked from commit 31ccec00da7e0e81781a523a9d1acbd926be6553)

3 years agomaintain complete cloned_set for BindParameter
Mike Bayer [Wed, 6 Apr 2022 13:41:11 +0000 (09:41 -0400)] 
maintain complete cloned_set for BindParameter

Fixed regression caused by :ticket:`7823` which impacted the caching
system, such that bound parameters that had been "cloned" within ORM
operations, such as polymorphic loading, would in some cases not acquire
their correct execution-time value leading to incorrect bind values being
rendered.

Fixes: #7903
Change-Id: I61c802749b859bebeb127d24e66d6e77d13ce57a
(cherry picked from commit 2168a64affb2e299b9a37079af7b2a8d4ae0ff64)

3 years agofix typo in lambda example
Mike Bayer [Tue, 5 Apr 2022 18:39:32 +0000 (14:39 -0400)] 
fix typo in lambda example

we might have an actual customer so clean up shop

Change-Id: I0b1e36ad78f364805a3a7bfd6fac953cf94b838f
(cherry picked from commit 7935b76d9e5b5fd4e64b2c6c3473737186acf2db)

3 years agoTableValuedAlias generation fixes
Mike Bayer [Sun, 3 Apr 2022 15:28:57 +0000 (11:28 -0400)] 
TableValuedAlias generation fixes

Fixed bug in newly implemented
:paramref:`.FunctionElement.table_valued.joins_implicitly` feature where
the parameter would not automatically propagate from the original
:class:`.TableValuedAlias` object to the secondary object produced when
calling upon :meth:`.TableValuedAlias.render_derived` or
:meth:`.TableValuedAlias.alias`.

Additionally repaired these issues in :class:`.TableValuedAlias`:

* repaired a potential memory issue which could occur when
repeatedly calling :meth:`.TableValuedAlias.render_derived` against
successive copies of the same object (for .alias(), we currently
have to still continue chaining from the previous element.  not sure
if this can be improved but this is standard behavior for .alias()
elsewhere)
* repaired issue where the individual element types would be lost when
calling upon :meth:`.TableValuedAlias.render_derived` or
:meth:`.TableValuedAlias.alias`.

Fixes: #7890
Change-Id: Ie5120c7ff1e5c1bba5aaf77c782a51c637860208
(cherry picked from commit c315c7401a2aa00a8a0fa0f7d4189a9976fd7962)

3 years agoclarify alternative mapping example
Mike Bayer [Sun, 3 Apr 2022 14:39:19 +0000 (10:39 -0400)] 
clarify alternative mapping example

this second example is not part of the doctest steps,
clarify that it's not part of code examples to be present
in execution steps.   Add an extra registry +
declarative base on top
so that even if someone does run it, the Base will have
been reset and the examples will continue to work
(noting that column order in statements may change, but
probably nothing else).

Fixes: #7891
Change-Id: Icb1ba310230841e502185d9d0cadd3c18d467292
(cherry picked from commit 1dffb7cedeb009ca6c532db558bd0588dd846957)

3 years agofix small indentation typo (#7882)
Maple [Sun, 3 Apr 2022 09:30:08 +0000 (17:30 +0800)] 
fix small indentation typo (#7882)