You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pleaseaddacodesnippethere, thatreproducestheproblemcompletely```pyfrombeanieimportDocumentclassPlayer(Document): # This is the modelname: strmoney: intasyncdefmain():
doc=Player(name="test",money=500)
awaitdoc.set({Player.money:100})
awaitdoc.inc({Player.money:100})
Expected behavior
The behavior is only changed for the type hint, so i expect set allowing any type and inc allowing number type
The $inc operator accepts positive and negative values.
The $set operator replaces the value of a field with the specified value.
Additional context
Unable to assign argument of type “dict[int, int]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “inc” function
Type “int” is not compatible with type “ExpressionField | str »
“int” is not compatible with “ExpressionField”
“int” is not compatible with “str”PylancereportArgumentType
Unable to assign argument of type “dict[int, int]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “set” function
Type “int” is not compatible with type “ExpressionField | str »
“int” is not compatible with “ExpressionField”
“int” is not compatible with “str”PylancereportArgumentType
The text was updated successfully, but these errors were encountered:
CAPITAINMARVEL
changed the title
[BUG] Issue with parameter expression: Dict[ExpressionField | str, Any] from .set and .inc method not allowing any as key for set and for inc a number
[BUG] Issue with parameter expression from inc set and update
Sep 5, 2024
Describe the bug
This bug is a type hint issue
To Reproduce
Expected behavior
The behavior is only changed for the type hint, so i expect set allowing any type and inc allowing number type
The $inc operator accepts positive and negative values.
The $set operator replaces the value of a field with the specified value.
Additional context
Unable to assign argument of type “dict[int, int]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “inc” function
Type “int” is not compatible with type “ExpressionField | str »
“int” is not compatible with “ExpressionField”
“int” is not compatible with “str”PylancereportArgumentType
Unable to assign argument of type “dict[int, int]” to parameter “expression” of type “Dict[ExpressionField | str, Any]” in the “set” function
Type “int” is not compatible with type “ExpressionField | str »
“int” is not compatible with “ExpressionField”
“int” is not compatible with “str”PylancereportArgumentType
The text was updated successfully, but these errors were encountered: