mistercrunch closed pull request #4071: Fix for SQL editor throwing can't 
deserialize google.cloud.bigquery._helpers.Row with BigQuery
URL: https://github.com/apache/incubator-superset/pull/4071
 
 
   

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/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 51fa0553f6..01e7236164 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -1179,6 +1179,14 @@ def convert_dttm(cls, target_type, dttm):
             return "{}'".format(dttm.strftime('%Y-%m-%d'))
         return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
 
+    @classmethod
+    def fetch_data(cls, cursor, limit):
+        data = super(BQEngineSpec, cls).fetch_data(cursor, limit)
+        from google.cloud.bigquery._helpers import Row  # pylint: 
disable=import-error
+        if len(data) != 0 and isinstance(data[0], Row):
+            data = [r.values() for r in data]
+        return data
+
 
 class ImpalaEngineSpec(BaseEngineSpec):
     """Engine spec for Cloudera's Impala"""


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to