Skip to content

Commit

Permalink
[hotfix] not grouped by -2
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Feb 26, 2017
1 parent 55e462d commit 10ea635
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superset",
"version": "0.16.1rc3",
"version": "0.16.1rc4",
"description": "Superset is a data exploration platform designed to be visual, intuitive, and interactive.",
"license": "Apache-2.0",
"directories": {
Expand Down
15 changes: 7 additions & 8 deletions superset/assets/visualizations/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ function tableVis(slice, payload) {
const fd = slice.formData;
// Removing metrics (aggregates) that are strings
const realMetrics = [];
if (fd.metrics) {
for (const k in data.records[0]) {
if (fd.metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
realMetrics.push(k);
}
let metrics = fd.metrics || [];
for (const k in data.records[0]) {
if (metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
realMetrics.push(k);
}
}
const metrics = realMetrics;
metrics = realMetrics;

function col(c) {
const arr = [];
Expand Down Expand Up @@ -145,8 +144,8 @@ function tableVis(slice, payload) {
fixDataTableBodyHeight(
container.find('.dataTables_wrapper'), height);
// Sorting table by main column
if (fd.metrics.length > 0) {
const mainMetric = fd.metrics[0];
if (metrics.length > 0) {
const mainMetric = metrics[0];
datatable.column(data.columns.indexOf(mainMetric)).order('desc').draw();
}
container.parents('.widget').find('.tooltip').remove();
Expand Down

0 comments on commit 10ea635

Please sign in to comment.