mistercrunch closed pull request #4396: Fix markup broken since cache related 
changes
URL: https://github.com/apache/incubator-superset/pull/4396
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/viz.py b/superset/viz.py
index 4ab345c5d0..6149b6fb35 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -286,9 +286,12 @@ def cache_key(self, query_obj):
     def get_payload(self, query_obj=None):
         """Returns a payload of metadata and data"""
         payload = self.get_df_payload(query_obj)
-        df = payload['df']
-        if df is not None:
-            payload['data'] = self.get_data(df)
+
+        df = payload.get('df')
+        if df is not None and len(df.index) == 0:
+            raise Exception('No data')
+        payload['data'] = self.get_data(df)
+
         del payload['df']
         return payload
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to