Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] markup and iframe viz raise 'Empty query' #4225

Merged
merged 1 commit into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 10 additions & 4 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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


Expand Down