john-bodley commented on a change in pull request #9378: chore: bump black to 19.10b0 and mypy to 0.770 URL: https://github.com/apache/incubator-superset/pull/9378#discussion_r402688153
########## File path: superset/connectors/druid/models.py ########## @@ -941,23 +941,24 @@ def metrics_and_post_aggs( adhoc_agg_configs = [] postagg_names = [] for metric in metrics: - if utils.is_adhoc_metric(metric): + if isinstance(metric, dict) and utils.is_adhoc_metric(metric): Review comment: I'm surprised this was necessary as it seems `is_adhoc_metric(metric)` can handle both a `dict` and `str`. I wonder in adding typing there, i.e., ```python is_adhoc_metric(metric: Union[Dict[str, Any], str]) -> bool: ``` would remove the need for `isinstance(metric, dict)` which is unnecessary. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org