summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/coercions.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-12-29 19:26:08 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-01-01 11:28:24 -0500
commiteee7a3add99df2865e6d907f29f84f6d4ce22a8b (patch)
treea7c6be5c0dbba0238e6174adc734cb55d2af3faa /lib/sqlalchemy/sql/coercions.py
parente913ec8155b64e055f3a88ca9c1bb7f112202c76 (diff)
downloadsqlalchemy-eee7a3add99df2865e6d907f29f84f6d4ce22a8b.tar.gz
remove 2.0-removed Query elements
* :meth:`_orm.Query.join` no longer accepts the "aliased" and "from_joinpoint" arguments * :meth:`_orm.Query.join` no longer accepts chains of multiple join targets in one method call. * ``Query.from_self()`` and ``Query.with_polymorphic()`` are removed. Change-Id: I534d04b53a538a4fc374966eb2bc8eb98a16497d References: #7257
Diffstat (limited to 'lib/sqlalchemy/sql/coercions.py')
-rw-r--r--lib/sqlalchemy/sql/coercions.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py
index fa21fbeef..1a0336c67 100644
--- a/lib/sqlalchemy/sql/coercions.py
+++ b/lib/sqlalchemy/sql/coercions.py
@@ -606,22 +606,15 @@ class InElementImpl(RoleImpl):
return element
-class OnClauseImpl(_CoerceLiterals, _ColumnCoercions, RoleImpl):
+class OnClauseImpl(_ColumnCoercions, RoleImpl):
__slots__ = ()
_coerce_consts = True
- def _text_coercion(self, element, argname=None, legacy=False):
- if legacy and isinstance(element, str):
- util.warn_deprecated_20(
- "Using strings to indicate relationship names in "
- "Query.join() is deprecated and will be removed in "
- "SQLAlchemy 2.0. Please use the class-bound attribute "
- "directly."
- )
- return element
-
- return super(OnClauseImpl, self)._text_coercion(element, argname)
+ def _literal_coercion(
+ self, element, name=None, type_=None, argname=None, is_crud=False, **kw
+ ):
+ self._raise_for_expected(element)
def _post_coercion(self, resolved, original_element=None, **kw):
# this is a hack right now as we want to use coercion on an
@@ -936,8 +929,6 @@ class JoinTargetImpl(RoleImpl):
# #6550, unless JoinTargetImpl._skip_clauseelement_for_target_match
# were set to False.
return original_element
- elif legacy and isinstance(resolved, roles.WhereHavingRole):
- return resolved
elif legacy and resolved._is_select_statement:
util.warn_deprecated(
"Implicit coercion of SELECT and textual SELECT "