join-clause-groupby-fixes
All checks were successful
Deploy to core / deploy (push) Successful in 1m6s

This commit is contained in:
2024-02-23 03:03:34 +03:00
parent 60c7ab5fe4
commit 8d97463c1d
2 changed files with 2 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ def add_topic_stat_columns(q):
.add_columns(func.count(distinct(ShoutTopic.shout)).label('shouts_stat'))
.outerjoin(aliased_shout_author, ShoutTopic.shout == aliased_shout_author.shout)
.add_columns(func.count(distinct(aliased_shout_author.author)).label('authors_stat'))
.outerjoin(aliased_topic_follower)
.outerjoin(aliased_topic_follower, aliased_topic_follower.topic == Topic.id)
.add_columns(func.count(distinct(aliased_topic_follower.follower)).label('followers_stat'))
)
@@ -33,7 +33,7 @@ def add_author_stat_columns(q):
.add_columns(func.count(distinct(ShoutAuthor.shout)).label('shouts_stat'))
.outerjoin(aliased_author_authors, AuthorFollower.follower == Author.id)
.add_columns(func.count(distinct(aliased_author_authors.author)).label('authors_stat'))
.outerjoin(aliased_author_followers)
.outerjoin(aliased_author_followers, AuthorFollower.author == Author.id)
.add_columns(func.count(distinct(aliased_author_followers.follower)).label('followers_stat'))
)