Skip to content

Commit

Permalink
fix(client-core): Table pivot incorrectly behaves with multiple measures
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Apr 24, 2019
1 parent d7be090 commit adb2270
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/cubejs-client-core/dist/cubejs-client-core.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function () {
};
};

return this.pivot(pivotConfig).map(function (_ref19) {
return this.pivot(normalizedPivotConfig).map(function (_ref19) {
var xValues = _ref19.xValues,
yValuesArray = _ref19.yValuesArray;
return yValuesArray.map(function (_ref20) {
Expand All @@ -342,9 +342,9 @@ function () {
return normalizedPivotConfig.x.map(valueToObject(xValues, m)).concat(normalizedPivotConfig.y.map(valueToObject(yValues, m))).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}).reduce(function (a, b) {
return a.concat(b);
}).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}
}, {
Expand Down
8 changes: 4 additions & 4 deletions packages/cubejs-client-core/dist/cubejs-client-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function () {
};
};

return this.pivot(pivotConfig).map(function (_ref19) {
return this.pivot(normalizedPivotConfig).map(function (_ref19) {
var xValues = _ref19.xValues,
yValuesArray = _ref19.yValuesArray;
return yValuesArray.map(function (_ref20) {
Expand All @@ -346,9 +346,9 @@ function () {
return normalizedPivotConfig.x.map(valueToObject(xValues, m)).concat(normalizedPivotConfig.y.map(valueToObject(yValues, m))).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}).reduce(function (a, b) {
return a.concat(b);
}).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}
}, {
Expand Down
8 changes: 4 additions & 4 deletions packages/cubejs-client-core/dist/cubejs-client-core.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14304,7 +14304,7 @@
};
};

return this.pivot(pivotConfig).map(function (_ref19) {
return this.pivot(normalizedPivotConfig).map(function (_ref19) {
var xValues = _ref19.xValues,
yValuesArray = _ref19.yValuesArray;
return yValuesArray.map(function (_ref20) {
Expand All @@ -14315,9 +14315,9 @@
return normalizedPivotConfig.x.map(valueToObject(xValues, m)).concat(normalizedPivotConfig.y.map(valueToObject(yValues, m))).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}).reduce(function (a, b) {
return a.concat(b);
}).reduce(function (a, b) {
return Object.assign(a, b);
}, {});
});
}
}, {
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-client-core/src/ResultSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ export default class ResultSet {
})
);

return this.pivot(pivotConfig).map(({ xValues, yValuesArray }) => (
return this.pivot(normalizedPivotConfig).map(({ xValues, yValuesArray }) => (
yValuesArray.map(([yValues, m]) => (
normalizedPivotConfig.x.map(valueToObject(xValues, m))
.concat(normalizedPivotConfig.y.map(valueToObject(yValues, m)))
.reduce((a, b) => Object.assign(a, b), {})
))
)).reduce((a, b) => a.concat(b));
)).reduce((a, b) => Object.assign(a, b), {})
));
}

tableColumns(pivotConfig) {
Expand Down
6 changes: 3 additions & 3 deletions packages/cubejs-react/dist/cubejs-react.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: _core.version,
mode: _library ? 'pure' : 'global',
mode: 'global',
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
});
});
Expand Down Expand Up @@ -1434,7 +1434,7 @@
// Set @@toStringTag to native iterators
_setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
if (!_library && typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
Expand All @@ -1443,7 +1443,7 @@
$default = function values() { return $native.call(this); };
}
// Define iterator
if (BUGGY || VALUES_BUG || !proto[ITERATOR$3]) {
if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR$3])) {
_hide(proto, ITERATOR$3, $default);
}
// Plug for library
Expand Down

0 comments on commit adb2270

Please sign in to comment.