@@ -376,35 +376,35 @@ export class DatabricksDriver extends JDBCDriver {
376376 }
377377
378378 public override async testConnection ( ) {
379- let token : string ;
380-
381- // Databricks docs on accessing REST API
382- // https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m
383- if ( this . config . properties . OAuth2Secret ) {
384- const at = await this . getValidAccessToken ( ) ;
385- token = `Bearer ${ at } ` ;
386- } else {
387- token = `Bearer ${ this . config . properties . PWD } ` ;
388- }
389-
390- const res = await fetch ( `https://${ this . parsedConnectionProperties . host } /api/2.0/sql/warehouses/${ this . parsedConnectionProperties . warehouseId } ` , {
391- headers : { Authorization : token } ,
392- } ) ;
393-
394- if ( ! res . ok ) {
395- throw new Error ( `Databricks API error: ${ res . statusText } ` ) ;
396- }
397-
398- const data = await res . json ( ) ;
399-
400- if ( [ 'DELETING' , 'DELETED' ] . includes ( data . state ) ) {
401- throw new Error ( `Warehouse is being deleted (current state: ${ data . state } )` ) ;
402- }
403-
404- // There is also DEGRADED status, but it doesn't mean that cluster is 100% not working...
405- if ( data . health ?. status === 'FAILED' ) {
406- throw new Error ( `Warehouse is unhealthy: ${ data . health ?. summary } . Details: ${ data . health ?. details } ` ) ;
407- }
379+ // let token: string;
380+ //
381+ // // Databricks docs on accessing REST API
382+ // // https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m
383+ // if (this.config.properties.OAuth2Secret) {
384+ // const at = await this.getValidAccessToken();
385+ // token = `Bearer ${at}`;
386+ // } else {
387+ // token = `Bearer ${this.config.properties.PWD}`;
388+ // }
389+ //
390+ // const res = await fetch(`https://${this.parsedConnectionProperties.host}/api/2.0/sql/warehouses/${this.parsedConnectionProperties.warehouseId}`, {
391+ // headers: { Authorization: token },
392+ // });
393+ //
394+ // if (!res.ok) {
395+ // throw new Error(`Databricks API error: ${res.statusText}`);
396+ // }
397+ //
398+ // const data = await res.json();
399+ //
400+ // if (['DELETING', 'DELETED'].includes(data.state)) {
401+ // throw new Error(`Warehouse is being deleted (current state: ${data.state})`);
402+ // }
403+ //
404+ // // There is also DEGRADED status, but it doesn't mean that cluster is 100% not working...
405+ // if (data.health?.status === 'FAILED') {
406+ // throw new Error(`Warehouse is unhealthy: ${data.health?.summary}. Details: ${data.health?.details}`);
407+ // }
408408 }
409409
410410 public override async loadPreAggregationIntoTable (
0 commit comments