@cubejs-client/core 0.28.52 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubejs-client/core",
3
- "version": "0.28.52",
3
+ "version": "0.29.0",
4
4
  "engines": {},
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,5 +45,5 @@
45
45
  "eslint-plugin-node": "^5.2.1",
46
46
  "jest": "^26.0.1"
47
47
  },
48
- "gitHead": "22f1fcf3dc77d5784eda6b8eff8bcd430652cc69"
48
+ "gitHead": "15502010fedcb085860d4f35267a57a6d60aa9ab"
49
49
  }
package/src/ResultSet.js CHANGED
@@ -355,7 +355,7 @@ class ResultSet {
355
355
  const pivotImpl = (resultIndex = 0) => {
356
356
  let groupByXAxis = groupByToPairs(({ xValues }) => this.axisValuesString(xValues));
357
357
 
358
- let measureValue = (row, measure) => row[measure];
358
+ const measureValue = (row, measure) => row[measure] || 0;
359
359
 
360
360
  if (
361
361
  pivotConfig.fillMissingDates &&
@@ -379,8 +379,6 @@ class ResultSet {
379
379
  );
380
380
  return series[resultIndex].map(d => [d, byXValues[d] || [{ xValues: [d], row: {} }]]);
381
381
  };
382
-
383
- measureValue = (row, measure) => row[measure] || 0;
384
382
  }
385
383
  }
386
384
 
@@ -187,7 +187,7 @@ describe('ResultSet', () => {
187
187
  {
188
188
  x: 'Name 1',
189
189
 
190
- 'Foo.count': null,
190
+ 'Foo.count': 0,
191
191
  xValues: [
192
192
  'Name 1'
193
193
  ],
@@ -235,8 +235,7 @@ describe('ResultSet', () => {
235
235
  expect(resultSet.chartPivot()).toEqual([
236
236
  {
237
237
  x: 'Name 1',
238
-
239
- 'Foo.count': undefined,
238
+ 'Foo.count': 0,
240
239
  xValues: [
241
240
  'Name 1'
242
241
  ],
@@ -255,11 +255,14 @@ describe('data blending', () => {
255
255
  xValues: ['2020-08-01T00:00:00.000'],
256
256
  'Orders.count': 1,
257
257
  'Australia,Users.count': 20,
258
+ 'Italy,Users.count': 0,
259
+ 'Spain,Users.count': 0
258
260
  },
259
261
  {
260
262
  x: '2020-08-02T00:00:00.000',
261
263
  xValues: ['2020-08-02T00:00:00.000'],
262
264
  'Orders.count': 2,
265
+ 'Australia,Users.count': 0,
263
266
  'Spain,Users.count': 34,
264
267
  'Italy,Users.count': 18,
265
268
  },