MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / self_group

Method self_group

lib/sqlalchemy/sql/selectable.py:6908–6925  ·  view source on GitHub ↗

Return a 'grouping' construct as per the :class:`_expression.ClauseElement` specification. This produces an element that can be embedded in an expression. Note that this method is called automatically as needed when constructing expressions and should not require exp

(
        self, against: Optional[OperatorType] = None
    )

Source from the content-addressed store, hash-verified

6906 )
6907
6908 def self_group(
6909 self, against: Optional[OperatorType] = None
6910 ) -> Union[SelectStatementGrouping[Self], Self]:
6911 """Return a 'grouping' construct as per the
6912 :class:`_expression.ClauseElement` specification.
6913
6914 This produces an element that can be embedded in an expression. Note
6915 that this method is called automatically as needed when constructing
6916 expressions and should not require explicit use.
6917
6918 """
6919 if (
6920 isinstance(against, CompoundSelect)
6921 and not self._needs_parens_for_grouping()
6922 ):
6923 return self
6924 else:
6925 return SelectStatementGrouping(self)
6926
6927 def union(
6928 self, *other: _SelectStatementForCompoundArgument[Unpack[_Ts]]

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected