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

Method _regroup

lib/sqlalchemy/sql/selectable.py:6936–6950  ·  view source on GitHub ↗
(
        self,
        fn: Callable[[Select[Any]], Select[Any]],
    )

Source from the content-addressed store, hash-verified

6934 return []
6935
6936 def _regroup(
6937 self,
6938 fn: Callable[[Select[Any]], Select[Any]],
6939 ) -> ScalarSelect[Any]:
6940
6941 assert isinstance(self.element, ScalarSelect)
6942 element = self.element.element
6943 if not isinstance(element, Select):
6944 raise exc.InvalidRequestError(
6945 "Can only apply this operation to a plain SELECT construct"
6946 )
6947 new_element = fn(element)
6948
6949 return_value = new_element.scalar_subquery()
6950 return return_value
6951
6952 def select(self) -> Select[Tuple[bool]]:
6953 r"""Return a SELECT of this :class:`_expression.Exists`.

Callers 4

correlateMethod · 0.95
correlate_exceptMethod · 0.95
select_fromMethod · 0.95
whereMethod · 0.95

Calls 1

scalar_subqueryMethod · 0.45

Tested by

no test coverage detected