mistercrunch commented on a change in pull request #4646: Allowing limit 
ordering by post-aggregation metrics
URL: 
https://github.com/apache/incubator-superset/pull/4646#discussion_r175649264
 
 

 ##########
 File path: superset/connectors/druid/models.py
 ##########
 @@ -1134,7 +1137,11 @@ def run_query(  # noqa / druid
             pre_qry = deepcopy(qry)
             if timeseries_limit_metric:
                 order_by = timeseries_limit_metric
-                pre_qry['aggregations'] = 
self.get_aggregations([timeseries_limit_metric])
+                aggs_dict, post_aggs_dict = DruidDatasource.aggs_and_post_aggs(
+                    [timeseries_limit_metric],
+                    metrics_dict)
+                pre_qry['aggregations'].update(aggs_dict)
 
 Review comment:
   I'm unclear here as to why `.update` as opposed to direct affectations for 
both 1143 and 1144

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to