Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in Support more druid postaggregations#2235 #2345

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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