Fixed typing issue with :meth:`_sql.Existing.select_from` that
prevented its use with ORM classes.
Fixes: #10337
Change-Id: I4324c09054803f0b1ae7c4bde202cad0b55e1a4f
--- /dev/null
+.. change::
+ :tags: bug, typing
+ :tickets: 10337
+
+ Fixed typing issue with :meth:`_sql.Existing.select_from` that
+ prevented its use with ORM classes.
)
return e
- def select_from(self, *froms: FromClause) -> Self:
+ def select_from(self, *froms: _FromClauseArgument) -> Self:
"""Return a new :class:`_expression.Exists` construct,
applying the given
expression to the :meth:`_expression.Select.select_from`
from sqlalchemy import column
from sqlalchemy import create_engine
from sqlalchemy import delete
+from sqlalchemy import exists
from sqlalchemy import func
from sqlalchemy import insert
from sqlalchemy import Integer
# EXPECTED_TYPE: FromClause
reveal_type(a4)
+
+
+def test_select_from() -> None:
+ select(1).select_from(User).exists()
+ exists(1).select_from(User).select()