tortoise-orm
tortoise-orm copied to clipboard
Typing for ValuesListQuery.__await__() is incorrect
Describe the bug The typing for ValuesListQuery.await() is incorrect.
The current code reads:
def __await__(self) -> Generator[Any, None, Union[List[Any], Tuple]]: ...
However, what it should read is:
def __await__(self) -> Generator[Any, None, Union[List[Union[List[Any], Tuple]], Union[List[Any], Tuple], Any]]: ...
The reasoning is that right now, you can get 3 types of values from a ValuesListQuery:
- A list containing lists
- A list of single values (if flat=True)
- A scalar (if flat=True)
There might be a better way to provide the typing but I'm not sure on it.