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 2022/11/20 08:19:55 UTC

[GitHub] [superset] sinhashubham95 commented on a diff in pull request #22147: fix: Unhandled exception for Any metric type

sinhashubham95 commented on code in PR #22147:
URL: https://github.com/apache/superset/pull/22147#discussion_r1027245816


##########
superset/connectors/base/models.py:
##########
@@ -313,7 +313,9 @@ def data_for_slices(  # pylint: disable=too-many-locals
                     metric_names.add(utils.get_metric_name(metric))
                     if utils.is_adhoc_metric(metric):
                         column_names.add(
-                            (metric.get("column") or {}).get("column_name")
+                            (
+                                (hasattr(metric, "get") and metric.get("column")) or {}
+                            ).get("column_name")

Review Comment:
   @villebro sorry for the late reply. As you mentioned correctly, I missed the check for `AdhocMetric`. The issue was not with `metric` param, rather with `column`. Added a check around that.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org