From 79438e3f46b1a06d9db6acae9e5a0b6943766470 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sat, 27 Aug 2022 11:35:51 +0200 Subject: [PATCH] improve type of dynamic (#226) --- sqlalchemy-stubs/orm/dynamic.pyi | 37 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/sqlalchemy-stubs/orm/dynamic.pyi b/sqlalchemy-stubs/orm/dynamic.pyi index a55a4cd..98b5f36 100644 --- a/sqlalchemy-stubs/orm/dynamic.pyi +++ b/sqlalchemy-stubs/orm/dynamic.pyi @@ -1,4 +1,5 @@ from typing import Any +from typing import List from typing import Optional from . import attributes as attributes @@ -112,25 +113,29 @@ class AppenderQuery(Generative): def autoflush(self, setting: Any) -> None: ... @property def statement(self): ... - def filter(self, *criteria: Any): ... - def where(self, *criteria: Any) -> None: ... - def order_by(self, *criteria: Any) -> None: ... - def filter_by(self, **kwargs: Any) -> None: ... - def join(self, target: Any, *props: Any, **kwargs: Any) -> None: ... - def outerjoin(self, target: Any, *props: Any, **kwargs: Any) -> None: ... - def scalar(self): ... - def first(self): ... - def one(self): ... - def one_or_none(self): ... - def all(self): ... + def filter(self, *criteria: Any) -> AppenderQuery: ... + def where(self, *criteria: Any) -> AppenderQuery: ... + def order_by(self, *criteria: Any) -> AppenderQuery: ... + def filter_by(self, **kwargs: Any) -> AppenderQuery: ... + def join( + self, target: Any, *props: Any, **kwargs: Any + ) -> AppenderQuery: ... + def outerjoin( + self, target: Any, *props: Any, **kwargs: Any + ) -> AppenderQuery: ... + def scalar(self) -> Any: ... + def first(self) -> Any: ... + def one(self) -> Any: ... + def one_or_none(self) -> Any: ... + def all(self) -> List[Any]: ... def session(self): ... session: Any = ... def __iter__(self) -> Any: ... - def __getitem__(self, index: Any): ... - def limit(self, limit: Any) -> None: ... - def offset(self, offset: Any) -> None: ... - def slice(self, start: Any, stop: Any) -> None: ... - def count(self): ... + def __getitem__(self, index: Any) -> Any: ... + def limit(self, limit: Any) -> AppenderQuery: ... + def offset(self, offset: Any) -> AppenderQuery: ... + def slice(self, start: Any, stop: Any) -> AppenderQuery: ... + def count(self) -> int: ... def extend(self, iterator: Any) -> None: ... def append(self, item: Any) -> None: ... def remove(self, item: Any) -> None: ...