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

Method __init__

lib/sqlalchemy/sql/selectable.py:6906–6930  ·  view source on GitHub ↗
(
        self,
        __argument: Optional[
            Union[_ColumnsClauseArgument[Any], SelectBase, ScalarSelect[Any]]
        ] = None,
    )

Source from the content-addressed store, hash-verified

6904 inherit_cache = True
6905
6906 def __init__(
6907 self,
6908 __argument: Optional[
6909 Union[_ColumnsClauseArgument[Any], SelectBase, ScalarSelect[Any]]
6910 ] = None,
6911 ):
6912 s: ScalarSelect[Any]
6913
6914 # TODO: this seems like we should be using coercions for this
6915 if __argument is None:
6916 s = Select(literal_column("*")).scalar_subquery()
6917 elif isinstance(__argument, SelectBase):
6918 s = __argument.scalar_subquery()
6919 s._propagate_attrs = __argument._propagate_attrs
6920 elif isinstance(__argument, ScalarSelect):
6921 s = __argument
6922 else:
6923 s = Select(__argument).scalar_subquery()
6924
6925 UnaryExpression.__init__(
6926 self,
6927 s,
6928 operator=operators.exists,
6929 type_=type_api.BOOLEANTYPE,
6930 )
6931
6932 @util.ro_non_memoized_property
6933 def _from_objects(self) -> List[FromClause]:

Callers

nothing calls this directly

Calls 4

SelectClass · 0.85
literal_columnFunction · 0.85
scalar_subqueryMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected