You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/06/12 04:09:58 UTC
[GitHub] liyuance closed pull request #5143: strip druid metric type when
value is postagg
liyuance closed pull request #5143: strip druid metric type when value is postagg
URL: https://github.com/apache/incubator-superset/pull/5143
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py
index 99aff0cb02..214fd8d852 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -850,7 +850,7 @@ def find_postaggs_for(postagg_names, metrics_dict):
"""Return a list of metrics that are post aggregations"""
postagg_metrics = [
metrics_dict[name] for name in postagg_names
- if metrics_dict[name].metric_type == POST_AGG_TYPE
+ if (metrics_dict[name].metric_type).strip() == POST_AGG_TYPE
]
# Remove post aggregations that were found
for postagg in postagg_metrics:
@@ -910,7 +910,7 @@ def metrics_and_post_aggs(metrics, metrics_dict, druid_version=None):
for metric in metrics:
if utils.is_adhoc_metric(metric):
adhoc_agg_configs.append(metric)
- elif metrics_dict[metric].metric_type != POST_AGG_TYPE:
+ elif (metrics_dict[metric].metric_type).strip() != POST_AGG_TYPE:
saved_agg_names.add(metric)
else:
postagg_names.append(metric)
@@ -1027,7 +1027,7 @@ def get_aggregations(metrics_dict, saved_metrics, adhoc_metrics=[]):
for metric_name in saved_metrics:
if metric_name in metrics_dict:
metric = metrics_dict[metric_name]
- if metric.metric_type == POST_AGG_TYPE:
+ if (metric.metric_type).strip() == POST_AGG_TYPE:
invalid_metric_names.append(metric_name)
else:
aggregations[metric_name] = metric.json_obj
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org