Skip to content

Commit

Permalink
[hotfix] Table view doesn't allow SELECT (no group by) (#2274)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Feb 26, 2017
1 parent f9852bc commit 7339392
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions superset/assets/javascripts/explorev2/stores/visTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ const visTypes = {
],
},
],
controlOverrides: {
metrics: {
default: null,
validators: null,
},
},
},

markup: {
Expand Down
8 changes: 5 additions & 3 deletions superset/assets/visualizations/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ function tableVis(slice, payload) {
const fd = slice.formData;
// Removing metrics (aggregates) that are strings
const realMetrics = [];
for (const k in data.records[0]) {
if (fd.metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
realMetrics.push(k);
if (fd.metrics) {
for (const k in data.records[0]) {
if (fd.metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
realMetrics.push(k);
}
}
}
const metrics = realMetrics;
Expand Down

0 comments on commit 7339392

Please sign in to comment.