summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/coercions.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2020-09-13 12:37:40 -0600
committerMike Bayer <mike_mp@zzzcomputing.com>2020-09-28 12:08:04 -0400
commit75ac0abc7d5653d10006769a881374a46b706db5 (patch)
tree9c64b49a6e2ac92741c8a7d56b977e4bf23c287f /lib/sqlalchemy/sql/coercions.py
parent5dcddfd37e2666c298ba934e85be2ac0140efd27 (diff)
downloadsqlalchemy-75ac0abc7d5653d10006769a881374a46b706db5.tar.gz
Add deprecation warning for .join().alias()
The :meth:`_sql.Join.alias` method is deprecated and will be removed in SQLAlchemy 2.0. An explicit select + subquery, or aliasing of the inner tables, should be used instead. Fixes: #5010 Change-Id: Ic913afc31f0d70b0605f9a7af2742a0de1f9ad19
Diffstat (limited to 'lib/sqlalchemy/sql/coercions.py')
-rw-r--r--lib/sqlalchemy/sql/coercions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index b8525925b..154564a08 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -55,7 +55,7 @@ def _deep_is_literal(element):
return (
not isinstance(
element,
- (Visitable, schema.SchemaEventTarget, HasCacheKey, Options,),
+ (Visitable, schema.SchemaEventTarget, HasCacheKey, Options),
)
and not hasattr(element, "__clause_element__")
and (
@@ -881,7 +881,9 @@ class AnonymizedFromClauseImpl(StrictFromClauseImpl):
__slots__ = ()
def _post_coercion(self, element, flat=False, name=None, **kw):
- return element.alias(name=name, flat=flat)
+ assert name is None
+
+ return element._anonymous_fromclause(flat=flat)
class DMLTableImpl(_SelectIsNotFrom, _NoTextCoercion, RoleImpl):