You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/06/20 19:17:01 UTC

[GitHub] mistercrunch closed pull request #5121: [sql lab] Fix issue around VARBINARY type in Presto

mistercrunch closed pull request #5121: [sql lab] Fix issue around VARBINARY type in Presto
URL: https://github.com/apache/incubator-superset/pull/5121
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/requirements.txt b/requirements.txt
index 554ff9069a..802d175e5a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -28,7 +28,7 @@ python-dateutil==2.6.1
 python-geohash==0.8.5
 pyyaml==3.12
 requests==2.18.4
-simplejson==3.13.2
+simplejson==3.15.0
 six==1.11.0
 sqlalchemy==1.2.2
 sqlalchemy-utils==0.32.21
diff --git a/setup.py b/setup.py
index 3425b03f28..a1484bb6ad 100644
--- a/setup.py
+++ b/setup.py
@@ -81,7 +81,7 @@ def get_git_sha():
         'python-geohash',
         'pyyaml>=3.11',
         'requests',
-        'simplejson',
+        'simplejson>=3.15.0',
         'six',
         'sqlalchemy',
         'sqlalchemy-utils',
diff --git a/superset/utils.py b/superset/utils.py
index 08ce0d2f38..85c254b1ca 100644
--- a/superset/utils.py
+++ b/superset/utils.py
@@ -310,7 +310,6 @@ def datetime_f(dttm):
 
 
 def base_json_conv(obj):
-
     if isinstance(obj, numpy.int64):
         return int(obj)
     elif isinstance(obj, numpy.bool_):
@@ -323,6 +322,11 @@ def base_json_conv(obj):
         return str(obj)
     elif isinstance(obj, timedelta):
         return str(obj)
+    elif isinstance(obj, bytes):
+        try:
+            return '{}'.format(obj)
+        except Exception:
+            return '[bytes]'
 
 
 def json_iso_dttm_ser(obj, pessimistic=False):
diff --git a/superset/views/core.py b/superset/views/core.py
index b4a1689a91..aafe00b693 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2467,7 +2467,11 @@ def sql_json(self):
                     rendered_query,
                     return_results=True)
             payload = json.dumps(
-                data, default=utils.pessimistic_json_iso_dttm_ser, ignore_nan=True)
+                data,
+                default=utils.pessimistic_json_iso_dttm_ser,
+                ignore_nan=True,
+                encoding=None,
+            )
         except Exception as e:
             logging.exception(e)
             return json_error_response('{}'.format(e))


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org