Skip to content

Commit 0508ffd

Browse files
committed
Fix tests
1 parent c33671c commit 0508ffd

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

packages/cubejs-schema-compiler/adapter/BaseQuery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ class BaseQuery {
14751475
);
14761476
if (cubeNamesForTimeDimension.length === 1 && cubeNamesForTimeDimension[0] === cube) {
14771477
const dimensionSql = this.dimensionSql(dimension);
1478-
return `select ${aggFunction}(${dimensionSql}) from ${this.cubeSql(cube)} ${this.asSyntaxTable} ${this.cubeAlias(cube)}`;
1478+
return `select ${aggFunction}(${this.convertTz(dimensionSql)}) from ${this.cubeSql(cube)} ${this.asSyntaxTable} ${this.cubeAlias(cube)}`;
14791479
}
14801480
return null;
14811481
}

packages/cubejs-schema-compiler/test/MySqlPreAggregationsTest.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('MySqlPreAggregations', function test() {
181181
dimensions: [
182182
'visitors.source'
183183
],
184-
timezone: 'America/Los_Angeles',
184+
timezone: 'UTC',
185185
preAggregationsSchema: '',
186186
timeDimensions: [{
187187
dimension: 'visitors.createdAt',
@@ -205,9 +205,7 @@ describe('MySqlPreAggregations', function test() {
205205

206206
console.log(res);
207207

208-
res.should.be.deepEqual(
209-
[{ 'max(`visitors`.created_at)': '2017-01-07T08:00:00.000Z' }]
210-
);
208+
res[0][Object.keys(res[0])[0]].should.be.deepEqual('2017-01-07 00:00:00');
211209
});
212210
});
213211

packages/cubejs-schema-compiler/test/PreAggregationsTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ describe('PreAggregations', function test() {
495495
granularity: 'day',
496496
dateRange: ['2017-01-01', '2017-01-25']
497497
}],
498-
timezone: 'America/Los_Angeles',
498+
timezone: 'UTC',
499499
order: [{
500500
id: 'EveryHourVisitors.createdAt'
501501
}],

0 commit comments

Comments
 (0)