diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-10-22 17:37:07 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-10-25 19:45:28 -0400 |
| commit | 4a15f40a39d13a2efc2565178a687c50a4e16d22 (patch) | |
| tree | 78a9e4bd30e4a89efb01277ed81320bf185e5005 /lib | |
| parent | 92aa35e7fc737de58c25d6c22bf1c48f6c4c714b (diff) | |
| download | sqlalchemy-4a15f40a39d13a2efc2565178a687c50a4e16d22.tar.gz | |
warnings: select_entity_from()
Change-Id: I8c259e61134c38a1fa907c308068337473c82914
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/context.py | 12 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/warnings.py | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py index 45df57c5d..0a93d993a 100644 --- a/lib/sqlalchemy/orm/context.py +++ b/lib/sqlalchemy/orm/context.py @@ -1251,8 +1251,12 @@ class ORMSelectCompileState(ORMCompileState, SelectState): adapters = [] - # vvvvvvvvvvvvvvv legacy vvvvvvvvvvvvvvvvvv if self._from_obj_alias: + # used for legacy going forward for query set_ops, e.g. + # union(), union_all(), etc. + # 1.4 and previously, also used for from_self(), + # select_entity_from() + # # for the "from obj" alias, apply extra rule to the # 'ORM only' check, if this query were generated from a # subquery of itself, i.e. _from_selectable(), apply adaption @@ -1266,11 +1270,15 @@ class ORMSelectCompileState(ORMCompileState, SelectState): ) ) + # vvvvvvvvvvvvvvv legacy vvvvvvvvvvvvvvvvvv + # this can totally go away when we remove join(..., aliased=True) if self._aliased_generations: adapters.append((False, self._adapt_aliased_generation)) # ^^^^^^^^^^^^^ legacy ^^^^^^^^^^^^^^^^^^^^^ - # this is the only adapter we would need going forward... + # this was *hopefully* the only adapter we were going to need + # going forward...however, we unfortunately need _from_obj_alias + # for query.union(), which we can't drop if self._polymorphic_adapters: adapters.append((False, self._adapt_polymorphic_element)) diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py index 9886b122d..40d03f0af 100644 --- a/lib/sqlalchemy/testing/warnings.py +++ b/lib/sqlalchemy/testing/warnings.py @@ -71,7 +71,6 @@ def setup_filters(): r"The Query\.get\(\) method", r"The Query\.with_parent\(\) method", r"The Query\.with_parent\(\) method", - r"The Query\.select_entity_from\(\) method", r"The ``aliased`` and ``from_joinpoint`` keyword arguments", r"The Query.with_polymorphic\(\) method is considered " "legacy as of the 1.x series", |
