]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
raise informative error when selectable can't be extended
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 14:48:16 +0000 (10:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 17:00:14 +0000 (13:00 -0400)
commitd1142c6e9f6fb0e52bd496c56bdc88047df66c55
treefaf4c63574152fe306120db83d35b5e167620b3c
parentd97de97eff21af3bdacffc2b625feb7e0bd6c18c
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
doc/build/changelog/unreleased_14/8073.rst [new file with mode: 0644]
lib/sqlalchemy/sql/crud.py
lib/sqlalchemy/sql/dml.py
test/sql/test_insert.py