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 2020/04/16 21:59:13 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9560: [fix] warm up cache error handling

etr2460 commented on a change in pull request #9560: [fix] warm up cache error handling
URL: https://github.com/apache/incubator-superset/pull/9560#discussion_r409872880
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -1707,15 +1709,16 @@ def warm_up_cache(self):
                     form_data=form_data,
                     force=True,
                 )
-                obj.get_json()
+                payload = obj.get_payload()
+                error = payload["error"]
+                status = payload["status"]
             except Exception as ex:
-                logger.exception("Failed to warm up cache")
-                return json_error_response(utils.error_msg_from_exception(ex))
-        return json_success(
-            json.dumps(
-                [{"slice_id": slc.id, "slice_name": slc.slice_name} for slc in slices]
-            )
-        )
+                error = utils.error_msg_from_exception(ex)
+                status = None
+
+            result.append({"slice_id": slc.id, "error": error, "status": status})
 
 Review comment:
   this is the error and the status coming from the `get_viz` function, so perhaps this should be `viz_error` and `viz_status`? That seems clearer than payload_error/status since payload doesn't have a lot of meaning in the scope of a `warm_up_cache` function (it makes me ask "what payload?")

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