left-join-fix

This commit is contained in:
Untone 2024-04-23 15:27:19 +03:00
parent 870d5b62dc
commit 83204d1dff

View File

@ -119,6 +119,7 @@ def get_author_comments_stat(author_id: int):
select(
Author.id, func.coalesce(func.count(Reaction.id)).label("comments_count")
)
.select_from(Author) # явно указываем левый элемент join'а
.outerjoin(
Reaction,
and_(