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

This commit is contained in:
sirius0xdev 2026-07-07 18:32:02 -04:00
commit 8eabe3b5e8
No known key found for this signature in database
2 changed files with 20 additions and 3 deletions

View file

@ -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)