Skip to content

Commit

Permalink
Fix:fix bug in Support more druid postaggregations#2235
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeqing Fang committed Mar 7, 2017
1 parent 2b0cb2b commit da9b28e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,19 @@ def recursive_get_fields(_conf):
if m.metric_name in all_metrics:
aggregations[m.metric_name] = m.json_obj

# if quantiles/quantile post-agg without select agg
for v in post_aggs.values():
if isinstance(v, Quantiles) or isinstance(v, Quantile):
if v.name not in aggregations:
json_str = '{{\"type\": \"approxHistogramFold\",' \
'\"name\": \"{}\",\"fieldName\": \"{}\"}}'\
.format(v.name, v.name)
try:
obj = json.loads(json_str)
except Exception:
obj = {}
aggregations[v.name] = obj

rejected_metrics = [
m.metric_name for m in self.metrics
if m.is_restricted and
Expand Down

0 comments on commit da9b28e

Please sign in to comment.