Fix SQLAlchemy 2.0 count().filter(); add search_vector trigger for full-text search
Some checks failed
build-and-deploy / build (push) Failing after 15s
Some checks failed
build-and-deploy / build (push) Failing after 15s
This commit is contained in:
parent
49d5756ceb
commit
8eabe3b5e8
2 changed files with 20 additions and 3 deletions
|
|
@ -506,9 +506,9 @@ async def get_dashboard_summary():
|
|||
# Sentiment breakdown (last 24h)
|
||||
def sentiment_query():
|
||||
return select(
|
||||
func.count().where(events.c.sentiment_label == "positive").label("pos"),
|
||||
func.count().where(events.c.sentiment_label == "neutral").label("neu"),
|
||||
func.count().where(events.c.sentiment_label == "negative").label("neg"),
|
||||
func.count().filter(events.c.sentiment_label == "positive").label("pos"),
|
||||
func.count().filter(events.c.sentiment_label == "neutral").label("neu"),
|
||||
func.count().filter(events.c.sentiment_label == "negative").label("neg"),
|
||||
func.avg(events.c.sentiment_score).label("avg"),
|
||||
).where(events.c.ingested_at >= yesterday)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue