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/03 19:59:41 UTC

[GitHub] [superset] ktmud commented on a change in pull request #16053: fix(dashboard): 500 error caused by data_for_slices API

ktmud commented on a change in pull request #16053:
URL: https://github.com/apache/superset/pull/16053#discussion_r682061016



##########
File path: superset/connectors/base/models.py
##########
@@ -308,8 +307,8 @@ def data_for_slices(self, slices: List[Slice]) -> Dict[str, Any]:
 
             column_names.update(
                 column
-                for column in utils.get_iterable(form_data.get(param) or [])
-                for param in COLUMN_FORM_DATA_PARAMS
+                for column_param in COLUMN_FORM_DATA_PARAMS
+                for column in utils.get_iterable(form_data.get(column_param) or [])

Review comment:
       The order of the for loop is incorrect. Normally it will throw an undefined variable error but since `param` was used in other loops above, the code will still run. Just another example of why too many local variables is not a good thing.




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