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/12/17 17:07:04 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #17788: fix: accept null params for validation

betodealmeida commented on a change in pull request #17788:
URL: https://github.com/apache/superset/pull/17788#discussion_r771553353



##########
File path: superset/views/core.py
##########
@@ -2395,7 +2395,7 @@ def validate_sql_json(
         schema = request.form.get("schema") or None
         template_params = json.loads(request.form.get("templateParams") or "{}")
 
-        if len(template_params) > 0:
+        if template_params is not None and len(template_params) > 0:

Review comment:
       Nit, since in Python an empty list/dict is false you can simplify to:
   
   ```suggestion
           if template_params:
   ```




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