Skip to content

Commit c20518c

Browse files
committed
test(driver-sql): type the calendar-day pins' query and config instead of erasing them
Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
1 parent eab3f3b commit c20518c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎packages/drivers/driver-sql/src/sql-driver-21485-date-bucket-calendar-day.test.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
*/
6969

7070
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
71-
import { SqlDriver } from '../src/index.js';
71+
import { SqlDriver, type SqlDriverConfig } from '../src/index.js';
7272
import {
7373
DIALECT_CELLS,
7474
assertThreeWayZoneSkew,
@@ -186,7 +186,7 @@ function sessionRuns(cell: DialectCell): SessionRun[] {
186186
];
187187
}
188188

189-
function configFor(cell: DialectCell, run: SessionRun) {
189+
function configFor(cell: DialectCell, run: SessionRun): SqlDriverConfig {
190190
const base = cell.config();
191191
const sql = run.hostSessionSql;
192192
if (!sql) return base;
@@ -206,11 +206,9 @@ function measure(cell: DialectCell): void {
206206
let driver: SqlDriver;
207207

208208
beforeAll(async () => {
209-
driver = new SqlDriver(configFor(cell, run) as any);
209+
driver = new SqlDriver(configFor(cell, run));
210210
await driver.execute(`drop table if exists ${TABLE}`).catch(() => {});
211-
await driver.initObjects([
212-
{ name: TABLE, fields: { on: { type: 'date' }, at: { type: 'datetime' } } } as any,
213-
]);
211+
await driver.initObjects([{ name: TABLE, fields: { on: { type: 'date' }, at: { type: 'datetime' } } }]);
214212
for (const row of ROWS) {
215213
await driver.create(
216214
TABLE,
@@ -254,7 +252,7 @@ function measure(cell: DialectCell): void {
254252
const grouped = await driver.aggregate(TABLE, {
255253
groupBy: [{ field: axis, dateGranularity: g }],
256254
aggregations: [{ function: 'count', alias: 'n' }],
257-
} as any);
255+
});
258256
expect(bucketsOf(grouped as Record<string, unknown>[], axis), 'aggregate()').toEqual(want);
259257

260258
const expr = driver.dateBucketSql(TABLE, axis, g);

0 commit comments

Comments
 (0)