fix(models): prevent SQLAlchemy and_() deprecation warning (#37020)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Amin Ghadersohi
2026-01-12 11:53:04 -05:00
committed by GitHub
parent 169d27c9e9
commit 911d72c957

View File

@@ -3214,10 +3214,12 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
)
if granularity:
qry = qry.where(and_(*(time_filters + where_clause_and)))
else:
if time_filters or where_clause_and:
qry = qry.where(and_(*(time_filters + where_clause_and)))
elif where_clause_and:
qry = qry.where(and_(*where_clause_and))
qry = qry.having(and_(*having_clause_and))
if having_clause_and:
qry = qry.having(and_(*having_clause_and))
self.make_orderby_compatible(select_exprs, orderby_exprs)