mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
Fix: when query had unicode characters it was failling to execute
This commit is contained in:
parent
cf1d20c958
commit
c0c2fed6ac
@ -20,7 +20,7 @@ def gen_query_hash(sql):
|
||||
"""
|
||||
sql = COMMENTS_REGEX.sub("", sql)
|
||||
sql = "".join(sql.split()).lower()
|
||||
return hashlib.md5(sql).hexdigest()
|
||||
return hashlib.md5(sql.encode('utf-8')).hexdigest()
|
||||
|
||||
|
||||
class JSONEncoder(json.JSONEncoder):
|
||||
|
@ -24,7 +24,7 @@ class Job(object):
|
||||
wait_time=None, query_time=None,
|
||||
updated_at=None, status=None, error=None, query_result_id=None):
|
||||
self.data_manager = data_manager
|
||||
self.query = query
|
||||
self.query = query.decode('utf-8')
|
||||
self.priority = priority
|
||||
self.query_hash = gen_query_hash(self.query)
|
||||
self.query_result_id = query_result_id
|
||||
|
Loading…
Reference in New Issue
Block a user