You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/01/17 21:54:15 UTC
[GitHub] mistercrunch closed pull request #4225: [bugfix] markup and iframe viz raise 'Empty query'
mistercrunch closed pull request #4225: [bugfix] markup and iframe viz raise 'Empty query'
URL: https://github.com/apache/incubator-superset/pull/4225
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/views/core.py b/superset/views/core.py
index 1cd35931c6..ec4cce1fb1 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1035,8 +1035,7 @@ def generate_json(self, datasource_type, datasource_id, form_data,
return self.get_query_string_response(viz_obj)
try:
- payload = viz_obj.get_payload(
- force=force)
+ payload = viz_obj.get_payload(force=force)
except Exception as e:
logging.exception(e)
return json_error_response(utils.error_msg_from_exception(e))
diff --git a/superset/viz.py b/superset/viz.py
index e89dca921f..9d6a57d8fa 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -243,12 +243,12 @@ def cache_key(self, query_obj):
def get_payload(self, force=False):
"""Handles caching around the json payload retrieval"""
query_obj = self.query_obj()
- cache_key = self.cache_key(query_obj)
+ cache_key = self.cache_key(query_obj) if query_obj else None
cached_dttm = None
data = None
stacktrace = None
rowcount = None
- if not force and cache:
+ if cache_key and cache and not force:
cache_value = cache.get(cache_key)
if cache_value:
stats_logger.incr('loaded_from_cache')
@@ -536,7 +536,10 @@ class MarkupViz(BaseViz):
verbose_name = _('Markup')
is_timeseries = False
- def get_df(self):
+ def query_obj(self):
+ return None
+
+ def get_df(self, query_obj=None):
return None
def get_data(self, df):
@@ -1573,7 +1576,10 @@ class IFrameViz(BaseViz):
credits = 'a <a href="https://github.com/airbnb/superset">Superset</a> original'
is_timeseries = False
- def get_df(self):
+ def query_obj(self):
+ return None
+
+ def get_df(self, query_obj=None):
return None
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services