Skip to content

Commit 1205fff

Browse files
committed
fix: resolve ESLint errors in telemetry modules
Use dot notation for Authorization header access and convert buildTelemetryUrl to default export to satisfy lint rules. Co-authored-by: Isaac
1 parent 0201bda commit 1205fff

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/telemetry/DatabricksTelemetryExporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { LogLevel } from '../contracts/IDBSQLLogger';
2121
import { TelemetryMetric, DEFAULT_TELEMETRY_CONFIG } from './types';
2222
import { CircuitBreaker, CircuitBreakerRegistry } from './CircuitBreaker';
2323
import ExceptionClassifier from './ExceptionClassifier';
24-
import { buildTelemetryUrl } from './telemetryUtils';
24+
import buildTelemetryUrl from './telemetryUtils';
2525
import driverVersion from '../version';
2626

2727
/**
@@ -234,7 +234,7 @@ export default class DatabricksTelemetryExporter {
234234
// Skip export if authenticated mode is requested but no auth headers available.
235235
// Note: all auth providers in this codebase return plain objects (Record<string, string>).
236236
const headersObj = authHeaders as Record<string, string>;
237-
if (authenticatedExport && (!headersObj || !headersObj['Authorization'])) {
237+
if (authenticatedExport && (!headersObj || !headersObj.Authorization)) {
238238
logger.log(LogLevel.debug, 'Skipping telemetry export: authenticated mode but no Authorization header');
239239
return;
240240
}

lib/telemetry/FeatureFlagCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import fetch from 'node-fetch';
1818
import IClientContext from '../contracts/IClientContext';
1919
import { LogLevel } from '../contracts/IDBSQLLogger';
20-
import { buildTelemetryUrl } from './telemetryUtils';
20+
import buildTelemetryUrl from './telemetryUtils';
2121
import driverVersion from '../version';
2222

2323
/**

lib/telemetry/telemetryUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Build full URL from host and path, always using HTTPS.
1919
* Strips any existing protocol prefix and enforces HTTPS.
2020
*/
21-
export function buildTelemetryUrl(host: string, path: string): string {
21+
export default function buildTelemetryUrl(host: string, path: string): string {
2222
const cleanHost = host.replace(/^https?:\/\//, '').replace(/\/+$/, '');
2323
return `https://${cleanHost}${path}`;
2424
}

0 commit comments

Comments
 (0)