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/sqlalchemy/orm/context.py | |
parent | 92aa35e7fc737de58c25d6c22bf1c48f6c4c714b (diff) | |
download | sqlalchemy-4a15f40a39d13a2efc2565178a687c50a4e16d22.tar.gz |
warnings: select_entity_from()
Change-Id: I8c259e61134c38a1fa907c308068337473c82914
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r-- | lib/sqlalchemy/orm/context.py | 12 |
1 files changed, 10 insertions, 2 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)) |