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 2021/08/12 08:37:22 UTC

[GitHub] [superset] villebro commented on a change in pull request #16227: chore: upgrade mypy and add type guards

villebro commented on a change in pull request #16227:
URL: https://github.com/apache/superset/pull/16227#discussion_r687507053



##########
File path: superset/utils/core.py
##########
@@ -1306,7 +1305,7 @@ def get_metric_name(metric: Metric) -> str:
             if column_name:
                 return column_name
         raise ValueError(__("Invalid metric object"))
-    return cast(str, metric)
+    return metric  # type: ignore

Review comment:
       For some reason `mypy` didn't pick up that `Union[str, AdhocMetric]` becomes `str` after we do `is_adhoc_metric(metric)` above




-- 
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