]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
accept TableClause through mapped selectable chain
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 9 Jan 2023 13:53:57 +0000 (08:53 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 9 Jan 2023 14:29:31 +0000 (09:29 -0500)
commiteb9d00c4b4f4f15e871aa9ea88d41023054c6e97
tree04935d2a29ade93983d09b7da06f9131e3c41779
parenta76f4cbb7d3066f71b035b29e511eb811b810c9c
accept TableClause through mapped selectable chain

type annotation somehow decided that TableClause doesn't have
primary key fields which is not the case at all.   In particular
the "views" recipe relies on TableClause so adding a restriction
like this does not make any sense.

It seems the issue was to open this up for typing, by allowing
TableClause out as far as ddl.sort_tables() typing is passing
for now.   Support it out in get_bind() etc.

Fixes: #9071
Change-Id: If0e22e0e7df7bee0ff4b295b0ffacfbc6b7a0142
doc/build/changelog/unreleased_20/9071.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/sql/ddl.py
test/orm/test_bind.py
test/orm/test_mapper.py