BeanieODM / beanie

Asynchronous Python ODM for MongoDB
http://beanie-odm.dev/
Apache License 2.0
1.94k stars 203 forks source link

[BUG] type hint error on sorting #774

Closed CAPITAINMARVEL closed 7 months ago

CAPITAINMARVEL commented 8 months ago
class DocPlayer(Document):
    money: int

await DocPlayer.find_all().sort(-DocPlayer.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 Cannot assign type 'int' to type 'str | Tuple[str, SortDirection] | List[Tuple[str, SortDirection]] | None » “int” is not compatible with “str” “int” is not compatible with “Tuple[str, SortDirection]” “int” is not compatible with “List[Tuple[str, SortDirection]]” Type cannot be assigned to type 'None'

another type hint error happening on sorting ( I tried many combination and always that error )

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been stalled for 14 days with no activity.