This is an automated email from the ASF dual-hosted git repository.
arivero pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 911d72c957 fix(models): prevent SQLAlchemy and_() deprecation warning
(#37020)
911d72c957 is described below
commit 911d72c95783966e7503ac6fd7bcdd64c8400a84
Author: Amin Ghadersohi <[email protected]>
AuthorDate: Mon Jan 12 11:53:04 2026 -0500
fix(models): prevent SQLAlchemy and_() deprecation warning (#37020)
Co-authored-by: Claude Opus 4.5 <[email protected]>
---
superset/models/helpers.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index c180420a91..9be9efb43d 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -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)