suddjian commented on a change in pull request #15707:
URL: https://github.com/apache/superset/pull/15707#discussion_r670721149



##########
File path: superset/connectors/sqla/models.py
##########
@@ -1086,7 +1086,7 @@ def get_sqla_query(  # pylint: 
disable=too-many-arguments,too-many-locals,too-ma
 
         # To ensure correct handling of the ORDER BY labeling we need to 
reference the
         # metric instance if defined in the SELECT clause.
-        metrics_exprs_by_label = {m.name: m for m in metrics_exprs}
+        metrics_exprs_by_label = {m.key: m for m in metrics_exprs}

Review comment:
       I'd like to have more documentation on this as comments in the code. 
Would you mind adding a comment at line 942 describing what the purpose is of 
`key`, and also here specifying why we use the `key` attribute?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to