Skip to content

Commit 2e55194

Browse files
committed
test(thrift): adapt metricViewMetadata tests to post-abstraction DBSQLSession
Rebasing onto main brought in the #378 backend-abstraction, which changed the DBSQLSession constructor from `{ handle, context }` to `{ backend }`. The metricViewMetadata tests still assert the right thing (the driver's confOverlay carries the metric-view conf key, now built in ThriftSessionBackend), so switch their construction to the `createSessionForTest({ handle, context })` helper the rest of the suite uses post-abstraction. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent fd81e67 commit 2e55194

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/unit/DBSQLSession.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ describe('DBSQLSession', () => {
304304
it('should forward the metric-view conf via confOverlay when metricViewMetadata is true', async () => {
305305
const context = new ClientContextStub();
306306
const driver = sinon.spy(context.driver);
307-
const session = new DBSQLSession({ handle: sessionHandleStub, context });
307+
const session = createSessionForTest({ handle: sessionHandleStub, context });
308308

309309
await session.executeStatement('SELECT * FROM my_metric_view', { metricViewMetadata: true });
310310

@@ -316,7 +316,7 @@ describe('DBSQLSession', () => {
316316
it('should not set the metric-view conf when metricViewMetadata is omitted', async () => {
317317
const context = new ClientContextStub();
318318
const driver = sinon.spy(context.driver);
319-
const session = new DBSQLSession({ handle: sessionHandleStub, context });
319+
const session = createSessionForTest({ handle: sessionHandleStub, context });
320320

321321
await session.executeStatement('SELECT 1');
322322

@@ -328,7 +328,7 @@ describe('DBSQLSession', () => {
328328
it('should not set the metric-view conf when metricViewMetadata is false', async () => {
329329
const context = new ClientContextStub();
330330
const driver = sinon.spy(context.driver);
331-
const session = new DBSQLSession({ handle: sessionHandleStub, context });
331+
const session = createSessionForTest({ handle: sessionHandleStub, context });
332332

333333
await session.executeStatement('SELECT 1', { metricViewMetadata: false });
334334

@@ -340,7 +340,7 @@ describe('DBSQLSession', () => {
340340
it('should coexist with queryTags in the same confOverlay', async () => {
341341
const context = new ClientContextStub();
342342
const driver = sinon.spy(context.driver);
343-
const session = new DBSQLSession({ handle: sessionHandleStub, context });
343+
const session = createSessionForTest({ handle: sessionHandleStub, context });
344344

345345
await session.executeStatement('SELECT 1', {
346346
metricViewMetadata: true,

0 commit comments

Comments
 (0)