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 2019/07/18 05:11:20 UTC

[GitHub] [incubator-superset] mistercrunch commented on a change in pull request #7888: [sqla] Adding check for invalid filter columns

mistercrunch commented on a change in pull request #7888: [sqla] Adding check for invalid filter columns
URL: https://github.com/apache/incubator-superset/pull/7888#discussion_r304736592
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -649,7 +649,7 @@ def get_sqla_query(  # sqla
             elif m in metrics_dict:
                 metrics_exprs.append(metrics_dict.get(m).get_sqla_col())
             else:
-                raise Exception(_("Metric '{}' is not valid".format(m)))
+                raise Exception(_(f"Metric '{m}' does not exist"))
 
 Review comment:
   It was wrong before, but variable formatting with `get_text` should use a different formatting scheme. Should look something like `_("Metric '%(metric)s' does not exist", metric=metric)`
   https://pythonhosted.org/Flask-Babel/#flask.ext.babel.gettext

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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