From eaaa4c99e17fb055310103f9a06a1a0abc836ade Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 3 Oct 2024 21:30:21 -0700 Subject: [PATCH 1/2] feat: handled unknown dialect for cloud --- src/dbt_client/dbtCloudIntegration.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/dbt_client/dbtCloudIntegration.ts b/src/dbt_client/dbtCloudIntegration.ts index accbd2147..cb9eb4221 100644 --- a/src/dbt_client/dbtCloudIntegration.ts +++ b/src/dbt_client/dbtCloudIntegration.ts @@ -1023,6 +1023,15 @@ export class DBTCloudProjectIntegration } } + private firstRun = false; + private async retryOnce() { + if (this.firstRun) { + return; + } + this.firstRun = true; + this.findAdapterType(); + } + private async findAdapterType() { const adapterTypeCommand = this.dbtCloudCommand( new DBTCommand("Getting adapter type...", [ @@ -1063,6 +1072,11 @@ export class DBTCloudProjectIntegration error, ); } + if (!this.adapterType) { + setTimeout(() => { + this.retryOnce(); + }, 5000); + } } private async findVersion() { From fdfa089c57da5bcbac5990bf57ce6d343e1608c7 Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 3 Oct 2024 22:19:43 -0700 Subject: [PATCH 2/2] WIP --- src/dbt_client/dbtCloudIntegration.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/dbt_client/dbtCloudIntegration.ts b/src/dbt_client/dbtCloudIntegration.ts index cb9eb4221..54ef087de 100644 --- a/src/dbt_client/dbtCloudIntegration.ts +++ b/src/dbt_client/dbtCloudIntegration.ts @@ -238,7 +238,12 @@ export class DBTCloudProjectIntegration } if (!this.adapterType) { // We only fetch the adapter type once, as it may impact compilation preview otherwise - this.findAdapterType(); + const startTime = Date.now(); + await this.findAdapterType(); + const elapsedTime = Date.now() - startTime; + this.telemetry.sendTelemetryEvent("cloudFindAdapterTypeElapsedTime", { + elapsedTime: elapsedTime.toString(), + }); } if (!this.version) { await this.findVersion(); @@ -1029,7 +1034,13 @@ export class DBTCloudProjectIntegration return; } this.firstRun = true; - this.findAdapterType(); + const startTime = Date.now(); + await this.findAdapterType(); + const elapsedTime = Date.now() - startTime; + this.telemetry.sendTelemetryEvent("cloudFindAdapterTypeElapsedTime", { + elapsedTime: elapsedTime.toString(), + retry: "true", + }); } private async findAdapterType() {