]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
remove _implicit_subquery and all derived functions
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 16 Nov 2024 20:41:04 +0000 (15:41 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 17 Nov 2024 13:19:53 +0000 (08:19 -0500)
commit0cd1104323c51ae7f8e8a48a6e80da7e75290e3b
treebeb76868d111f1da669814ea2d0f59c1aad7befd
parent4c063e7df42a6a33182df2f9a49208358a7c00ff
remove _implicit_subquery and all derived functions

The ``.c`` and ``.columns`` attributes on the :class:`.Select` and
:class:`.TextualSelect` constructs, which are not instances of
:class:`.FromClause`, have been removed completely, in addition to the
``.select()`` method as well as other codepaths which would implicitly
generate a subquery from a :class:`.Select` without the need to explicitly
call the :meth:`.Select.subquery` method.

In the case of ``.c`` and ``.columns``, these attributes were never useful
in practice and have caused a great deal of confusion, hence were
deprecated back in version 1.4, and have emitted warnings since that
version.   Accessing the columns that are specific to a :class:`.Select`
construct is done via the :attr:`.Select.selected_columns` attribute, which
was added in version 1.4 to suit the use case that users often expected
``.c`` to accomplish.  In the larger sense, implicit production of
subqueries works against SQLAlchemy's modern practice of making SQL
structure as explicit as possible.

Note that this is **not related** to the usual :attr:`.FromClause.c` and
:attr:`.FromClause.columns` attributes, common to objects such as
:class:`.Table` and :class:`.Subquery`,  which are unaffected by this
change.

Fixes: #10236
Change-Id: If241b8674ccacce7e860bfed25b5d266bfe1aca7
17 files changed:
doc/build/changelog/unreleased_21/10236.rst [new file with mode: 0644]
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/testing/suite/__init__.py
lib/sqlalchemy/testing/suite/test_deprecations.py [deleted file]
test/aaa_profiling/test_memusage.py
test/orm/test_deprecations.py
test/sql/test_compiler.py
test/sql/test_deprecations.py
test/sql/test_operators.py
test/sql/test_roles.py
test/sql/test_selectable.py