xrmx commented on a change in pull request #4108: [BUGFIX]: Check datatype of
results before converting to DataFrame
URL:
https://github.com/apache/incubator-superset/pull/4108#discussion_r158581609
##########
File path: superset/sql_lab.py
##########
@@ -231,11 +231,12 @@ def handle_error(msg):
# check whether the result set is comprised of lists or dict
if data and len(data) > 0:
- first_row_type = type(data[0])
- if first_row_type is list or first_row_type is tuple:
- df_data = np.array(data)
- else:
+ first_row = data[0]
+ first_row_types = set([type(c) for c in first_row])
Review comment:
Is this more readable?
```
any([isinstance(c, dict) for c in first_row])
```
----------------------------------------------------------------
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