diff options
author | Gord Thompson <gord@gordthompson.com> | 2020-09-13 12:37:40 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-28 12:08:04 -0400 |
commit | 75ac0abc7d5653d10006769a881374a46b706db5 (patch) | |
tree | 9c64b49a6e2ac92741c8a7d56b977e4bf23c287f /lib/sqlalchemy/sql/roles.py | |
parent | 5dcddfd37e2666c298ba934e85be2ac0140efd27 (diff) | |
download | sqlalchemy-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/roles.py')
-rw-r--r-- | lib/sqlalchemy/sql/roles.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/sqlalchemy/sql/roles.py b/lib/sqlalchemy/sql/roles.py index 4205d9f0d..b88625b88 100644 --- a/lib/sqlalchemy/sql/roles.py +++ b/lib/sqlalchemy/sql/roles.py @@ -144,19 +144,7 @@ class AnonymizedFromClauseRole(StrictFromClauseRole): # calls .alias() as a post processor def _anonymous_fromclause(self, name=None, flat=False): - """A synonym for ``.alias()`` that is only present on objects of this - role. - - This is an implicit assurance of the target object being part of the - role where anonymous aliasing without any warnings is allowed, - as opposed to other kinds of SELECT objects that may or may not have - an ``.alias()`` method. - - The method is used by the ORM but is currently semi-private to - preserve forwards-compatibility. - - """ - return self.alias(name=name, flat=flat) + raise NotImplementedError() class CoerceTextStatementRole(SQLRole): |