Skip to content

Commit

Permalink
[table] metric ordering is wrong in some cases (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Mar 9, 2017
1 parent e817382 commit 9a8c3a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions superset/assets/visualizations/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ function tableVis(slice, payload) {

const data = payload.data;
const fd = slice.formData;

// Removing metrics (aggregates) that are strings
const realMetrics = [];
let metrics = fd.metrics || [];
for (const k in data.records[0]) {
if (metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
realMetrics.push(k);
}
}
metrics = realMetrics;
metrics = metrics.filter(m => !isNaN(data.records[0][m]));

function col(c) {
const arr = [];
Expand Down

0 comments on commit 9a8c3a0

Please sign in to comment.