Skip to content

Commit b8f337a

Browse files
authored
SQLAlchemy: Annotate text() (#9498)
1 parent b76e617 commit b8f337a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

stubs/SQLAlchemy/sqlalchemy/sql/elements.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from _typeshed import Incomplete, Self
12
from typing import Any, Generic, TypeVar
23
from typing_extensions import Literal
34

@@ -136,8 +137,8 @@ class TextClause(
136137
def __and__(self, other): ...
137138
key: Any
138139
text: Any
139-
def __init__(self, text, bind: Any | None = ...): ...
140-
def bindparams(self, *binds, **names_to_values) -> None: ...
140+
def __init__(self, text: str, bind: Incomplete | None = None) -> None: ...
141+
def bindparams(self: Self, *binds, **names_to_values) -> Self: ...
141142
def columns(self, *cols, **types): ...
142143
@property
143144
def type(self): ...

stubs/SQLAlchemy/sqlalchemy/sql/expression.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ lateral: Incomplete
163163
or_: Incomplete
164164
bindparam: Incomplete
165165
select: Incomplete
166-
text: Incomplete
166+
167+
def text(text: str, bind: Incomplete | None = None) -> TextClause: ...
168+
167169
table: Incomplete
168170
column: Incomplete
169171
over: Incomplete

0 commit comments

Comments
 (0)