Skip to content

Commit

Permalink
Mark database parameters in Peewee as optional
Browse files Browse the repository at this point in the history
Peewee injects database arguments using a decorator whenever a model
or query has a bound connection. Passing the argument is therefore not
required, even for some function parameters without default values.
  • Loading branch information
JockeTF committed Jan 28, 2025
1 parent 89b49d2 commit 74232e8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions stubs/peewee/peewee.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class BaseQuery(Node):
def objects(self, constructor: Incomplete | None = ...) -> Self: ...
def __sql__(self, ctx) -> None: ...
def sql(self): ...
def execute(self, database): ...
def execute(self, database: Incomplete | None = ...): ...
def iterator(self, database: Incomplete | None = ...): ...
def __iter__(self): ...
def __getitem__(self, value): ...
Expand Down Expand Up @@ -571,20 +571,20 @@ class SelectQuery(Query):
def select_from(self, *columns): ...

class SelectBase(_HashableSource, Source, SelectQuery): # type: ignore[misc]
def peek(self, database, n: int = ...): ...
def first(self, database, n: int = ...): ...
def scalar(self, database, as_tuple: bool = ..., as_dict: bool = ...): ...
def scalars(self, database) -> Generator[Incomplete, None, None]: ...
def count(self, database, clear_limit: bool = ...): ...
def exists(self, database): ...
def get(self, database): ...
def peek(self, database: Incomplete | None = ..., n: int = ...): ...
def first(self, database: Incomplete | None = ..., n: int = ...): ...
def scalar(self, database: Incomplete | None = ..., as_tuple: bool = ..., as_dict: bool = ...): ...
def scalars(self, database: Incomplete | None = ...) -> Generator[Incomplete, None, None]: ...
def count(self, database: Incomplete | None = ..., clear_limit: bool = ...): ...
def exists(self, database: Incomplete | None = ...): ...
def get(self, database: Incomplete | None = ...): ...

class CompoundSelectQuery(SelectBase):
lhs: Incomplete
op: Incomplete
rhs: Incomplete
def __init__(self, lhs, op, rhs) -> None: ...
def exists(self, database): ...
def exists(self, database: Incomplete | None = ...): ...
def __sql__(self, ctx): ...

class Select(SelectBase):
Expand Down

0 comments on commit 74232e8

Please sign in to comment.