villebro commented on a change in pull request #9284: Reduce dashboard 
bootstrap payload
URL: 
https://github.com/apache/incubator-superset/pull/9284#discussion_r391201223
 
 

 ##########
 File path: superset/connectors/base/models.py
 ##########
 @@ -213,6 +230,87 @@ def data(self) -> Dict[str, Any]:
             "select_star": self.select_star,
         }
 
+    @staticmethod
+    def get_metric_name_from_metric(
+        metric: Union[str, Dict[str, Any]]
+    ) -> Optional[str]:
+        if isinstance(metric, str):
+            return metric
+
+        if isinstance(metric, dict) and metric.get("metric_name"):
+            return metric.get("metric_name")
+
+        return None
 
 Review comment:
   I might be wrong here, but isn't this function already implemented in `from 
superset.utils.core import get_metric_name`? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to