Skip to content

Commit

Permalink
[druid] fix having clause
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 23, 2016
1 parent cef4a82 commit 12fa0e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions superset/models.py
Expand Up @@ -21,7 +21,6 @@
import sqlalchemy as sqla
from sqlalchemy.engine.url import make_url
from sqlalchemy.orm import subqueryload
from sqlalchemy.ext.hybrid import hybrid_property

import sqlparse
from dateutil.parser import parse
Expand Down Expand Up @@ -2040,7 +2039,9 @@ def recursive_get_fields(_conf):
del qry['dimensions']
qry['metric'] = list(qry['aggregations'].keys())[0]
client.topn(**qry)
elif len(groupby) > 1:
elif len(groupby) > 1 or having_filters:
# If grouping on multiple fields or using a having filter
# we have to force a groupby query
if timeseries_limit and is_timeseries:
order_by = metrics[0] if metrics else self.metrics[0]
if timeseries_limit_metric:
Expand Down

0 comments on commit 12fa0e8

Please sign in to comment.