mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Alternative PR for: Some bytes/str issues in py3 w/ zlib and json (#2558)
* sql_lab.py: compress via utils * utils.py: added zlib_compress and zlib_compress_to_string * core.py: converted to use zlib_decompress_to_string; renamed uncompress to decompress in utils.py * utils_tests.py: added test for compress/decompress * fixed broken utils test; removed redundant code and empty lines from utils.py * utils.py: corrected docstrings, removed unnecessary 'else' * removed yet another superfluous else
This commit is contained in:
committed by
Maxime Beauchemin
parent
f19d1958c5
commit
c581ea8661
@@ -6,7 +6,6 @@ import logging
|
||||
import pandas as pd
|
||||
import sqlalchemy
|
||||
import uuid
|
||||
import zlib
|
||||
|
||||
from sqlalchemy.pool import NullPool
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
@@ -185,7 +184,7 @@ def get_sql_results(self, query_id, return_results=True, store_results=False):
|
||||
if store_results:
|
||||
key = '{}'.format(uuid.uuid4())
|
||||
logging.info("Storing results in results backend, key: {}".format(key))
|
||||
results_backend.set(key, zlib.compress(payload))
|
||||
results_backend.set(key, utils.zlib_compress(payload))
|
||||
query.results_key = key
|
||||
|
||||
session.merge(query)
|
||||
|
||||
Reference in New Issue
Block a user