Skip to content

Commit

Permalink
Merge pull request getredash#165 from alison985/162_fix_json_url_fetcher
Browse files Browse the repository at this point in the history
add catching key error & removing data_scanned from url query_runner
  • Loading branch information
alison985 authored Jul 26, 2017
2 parents 45aa946 + c0f6df8 commit 437ec9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions redash/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion redash/query_runner/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 437ec9b

Please sign in to comment.