-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] type pylance #696
Comments
Thank you for the catch |
I also have another isue with sorting It is not possible to assign the argument of type “int” to the parameter “args” of type “str | Tuple[str, SortDirection] | List[Tuple[str, SortDirection]] | None” in “sort” function await DocPlayer.find(DocPlayer.lb.rep >0).sort(-DocPlayer.lb.rep).project(ProjectTopRep).to_list()
class ProjectTopRep(BaseModel):
player_id: int
rep: int
class Settings:
projection = {"player_id": True, "rep": "$lb.rep"} |
Unable to assign argument of type “dict[bool, bool]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “set” function how to do it : class Player(Document):
player_id: int
hidestats: bool
await Product.find_one().set({Player.hidestats : True}) It does update the field but Pylance do not like it |
class Quiz(Document):
right: int
await Quiz.find_one(Quiz.id == self.quiz.id).inc({Quiz.right : 1}) Unable to assign argument of type “dict[int, int]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “inc” function |
class Player(Document):
money: int
data = await Player.find(
Player.money >0,
sort=[(Player.money, -1)]
).to_list() Unable to assign argument of type “list[tuple[int, Literal[-1]]]” to parameter “sort” of type “str | List[Tuple[str, SortDirection]] | None” in “find” function class Player(Document):
money: int
data = await Player.find(
Player.money >0).sort(-Player.money).to_list() Cannot assign argument of type "int" to parameter "args" of type "str | Tuple[str, SortDirection] | List[Tuple[str, SortDirection]] | None” in “sort” function |
Any plans to address the typing issues? |
#929 |
Describe the bug
so I did try the example from github and i have a pylance error
To Reproduce
(beanie example)
other issue
#807 and #864
The text was updated successfully, but these errors were encountered: