Skip to content

Commit

Permalink
Add parsing for nested json objects in resultset (#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu authored Feb 14, 2017
1 parent c564881 commit 83ef8a2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion superset/assets/javascripts/SqlLab/components/ResultSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,18 @@ class ResultSet extends React.PureComponent {
{sql}
<div className="ResultSet">
<Table
data={data}
data={data.map(function (row) {
const newRow = {};
for (const k in row) {
const val = row[k];
if (typeof(val) === 'string') {
newRow[k] = val;
} else {
newRow[k] = JSON.stringify(val);
}
}
return newRow;
})}
columns={results.columns.map((col) => col.name)}
sortable
className="table table-condensed table-bordered"
Expand Down

0 comments on commit 83ef8a2

Please sign in to comment.