MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _implicit_coercions

Method _implicit_coercions

lib/sqlalchemy/sql/coercions.py:560–575  ·  view source on GitHub ↗
(self, element, resolved, argname=None, **kw)

Source from the content-addressed store, hash-verified

558 )
559
560 def _implicit_coercions(self, element, resolved, argname=None, **kw):
561 original_element = element
562 if not getattr(resolved, "is_clause_element", False):
563 self._raise_for_expected(original_element, argname, resolved)
564 elif resolved._is_select_base:
565 self._warn_for_scalar_subquery_coercion()
566 return resolved.scalar_subquery()
567 elif resolved._is_from_clause and isinstance(
568 resolved, selectable.Subquery
569 ):
570 self._warn_for_scalar_subquery_coercion()
571 return resolved.element.scalar_subquery()
572 elif self._role_class.allows_lambda and resolved._is_lambda_element:
573 return resolved
574 else:
575 self._raise_for_expected(original_element, argname, resolved)
576
577
578def _no_text_coercion(

Callers

nothing calls this directly

Calls 3

_raise_for_expectedMethod · 0.45
scalar_subqueryMethod · 0.45

Tested by

no test coverage detected