diff --git a/redash/models.py b/redash/models.py index 9082ac9ce3..21c47d11bc 100644 --- a/redash/models.py +++ b/redash/models.py @@ -682,8 +682,8 @@ def get_latest(cls, data_source, query, max_age=0): def store_result(cls, org, data_source, query_hash, query, data, run_time, retrieved_at): try: data_scanned_information = json.loads(data)['data_scanned'] - except (ValueError, TypeError) as e: - data_scanned_information = 'error' + except (ValueError, TypeError, KeyError) as e: + data_scanned_information = '' query_result = cls(org=org, query_hash=query_hash, diff --git a/redash/query_runner/url.py b/redash/query_runner/url.py index 75f99f63a2..c99289cca4 100644 --- a/redash/query_runner/url.py +++ b/redash/query_runner/url.py @@ -54,7 +54,6 @@ def run_query(self, query, user): response = requests.get(url) response.raise_for_status() - response.update({'data_scanned':'N/A'}) json_data = response.content.strip() if not json_data: