Skip to content

Commit e084373

Browse files
committed
refactor: simplify int type typing
1 parent cf472f0 commit e084373

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/notebooks/deepnote/integrations/integrationDetector.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
DATAFRAME_SQL_INTEGRATION_ID,
77
DEEPNOTE_TO_INTEGRATION_TYPE,
88
IntegrationStatus,
9-
IntegrationWithStatus
9+
IntegrationWithStatus,
10+
RawIntegrationType
1011
} from '../../../platform/notebooks/deepnote/integrationTypes';
1112
import { IIntegrationDetector, IIntegrationStorage } from './types';
1213

@@ -53,8 +54,7 @@ export class IntegrationDetector implements IIntegrationDetector {
5354
logger.debug(`IntegrationDetector: Found integration: ${integrationId} (${projectIntegration.type})`);
5455

5556
// Map the Deepnote integration type to our IntegrationType
56-
const integrationType =
57-
DEEPNOTE_TO_INTEGRATION_TYPE[projectIntegration.type as keyof typeof DEEPNOTE_TO_INTEGRATION_TYPE];
57+
const integrationType = DEEPNOTE_TO_INTEGRATION_TYPE[projectIntegration.type as RawIntegrationType];
5858

5959
// Skip unknown integration types
6060
if (!integrationType) {

src/notebooks/deepnote/sqlCellStatusBarProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import { Commands } from '../../platform/common/constants';
2525
import {
2626
DATAFRAME_SQL_INTEGRATION_ID,
2727
DEEPNOTE_TO_INTEGRATION_TYPE,
28-
IntegrationType
28+
IntegrationType,
29+
RawIntegrationType
2930
} from '../../platform/notebooks/deepnote/integrationTypes';
3031
import { IDeepnoteNotebookManager } from '../types';
3132

@@ -334,8 +335,7 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
334335
continue;
335336
}
336337

337-
const integrationType =
338-
DEEPNOTE_TO_INTEGRATION_TYPE[projectIntegration.type as keyof typeof DEEPNOTE_TO_INTEGRATION_TYPE];
338+
const integrationType = DEEPNOTE_TO_INTEGRATION_TYPE[projectIntegration.type as RawIntegrationType];
339339
const typeLabel = integrationType ? this.getIntegrationTypeLabel(integrationType) : projectIntegration.type;
340340

341341
const item: LocalQuickPickItem = {

src/platform/notebooks/deepnote/integrationTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const INTEGRATION_TYPE_TO_DEEPNOTE = {
2020
[IntegrationType.BigQuery]: 'big-query'
2121
} as const satisfies { [type in IntegrationType]: string };
2222

23-
type RawIntegrationType = (typeof INTEGRATION_TYPE_TO_DEEPNOTE)[keyof typeof INTEGRATION_TYPE_TO_DEEPNOTE];
23+
export type RawIntegrationType = (typeof INTEGRATION_TYPE_TO_DEEPNOTE)[keyof typeof INTEGRATION_TYPE_TO_DEEPNOTE];
2424

2525
/**
2626
* Map Deepnote integration type strings to our IntegrationType enum

0 commit comments

Comments
 (0)