Skip to content

Commit 107035c

Browse files
committed
refactor: deduplicate EXCLUDED_INTEGRATION_ID constant and simplify to string
1 parent 22cdaac commit 107035c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/notebooks/deepnote/integrations/integrationDetector.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@ import { inject, injectable } from 'inversify';
22

33
import { logger } from '../../../platform/logging';
44
import { IDeepnoteNotebookManager } from '../../types';
5-
import { IntegrationStatus, IntegrationWithStatus } from './integrationTypes';
5+
import { DATAFRAME_SQL_INTEGRATION_ID, IntegrationStatus, IntegrationWithStatus } from './integrationTypes';
66
import { IIntegrationDetector, IIntegrationStorage } from './types';
77

88
/**
99
* Service for detecting integrations used in Deepnote notebooks
1010
*/
1111
@injectable()
1212
export class IntegrationDetector implements IIntegrationDetector {
13-
// Special integration IDs that should be excluded from management
14-
private readonly EXCLUDED_INTEGRATION_IDS = new Set(['deepnote-dataframe-sql']);
15-
1613
constructor(
1714
@inject(IIntegrationStorage) private readonly integrationStorage: IIntegrationStorage,
1815
@inject(IDeepnoteNotebookManager) private readonly notebookManager: IDeepnoteNotebookManager
@@ -48,7 +45,7 @@ export class IntegrationDetector implements IIntegrationDetector {
4845
const integrationId = block.metadata.sql_integration_id;
4946

5047
// Skip excluded integrations (e.g., internal DuckDB integration)
51-
if (this.EXCLUDED_INTEGRATION_IDS.has(integrationId)) {
48+
if (integrationId === DATAFRAME_SQL_INTEGRATION_ID) {
5249
logger.trace(
5350
`IntegrationDetector: Skipping excluded integration: ${integrationId} in block ${block.id}`
5451
);

src/notebooks/deepnote/integrations/integrationManager.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ import { Commands } from '../../../platform/common/constants';
66
import { logger } from '../../../platform/logging';
77
import { IntegrationWebviewProvider } from './integrationWebview';
88
import { IIntegrationDetector, IIntegrationStorage } from './types';
9-
import { IntegrationStatus, IntegrationWithStatus } from './integrationTypes';
9+
import { DATAFRAME_SQL_INTEGRATION_ID, IntegrationStatus, IntegrationWithStatus } from './integrationTypes';
1010

1111
/**
1212
* Manages integration UI and commands for Deepnote notebooks
1313
*/
1414
@injectable()
1515
export class IntegrationManager {
16-
// Special integration IDs that should be excluded from management
17-
private readonly EXCLUDED_INTEGRATION_IDS = new Set(['deepnote-dataframe-sql']);
18-
1916
private hasIntegrationsContext = 'deepnote.hasIntegrations';
2017

2118
private hasUnconfiguredIntegrationsContext = 'deepnote.hasUnconfiguredIntegrations';
@@ -134,7 +131,7 @@ export class IntegrationManager {
134131
const integrationId = deepnoteMetadata.sql_integration_id;
135132

136133
// Skip excluded integrations (e.g., internal DuckDB integration)
137-
if (this.EXCLUDED_INTEGRATION_IDS.has(integrationId)) {
134+
if (integrationId === DATAFRAME_SQL_INTEGRATION_ID) {
138135
logger.trace(`IntegrationManager: Skipping excluded integration: ${integrationId}`);
139136
continue;
140137
}

src/notebooks/deepnote/integrations/integrationTypes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Special integration ID that should be excluded from management.
3+
* This is the internal DuckDB integration that doesn't require configuration.
4+
*/
5+
export const DATAFRAME_SQL_INTEGRATION_ID = 'deepnote-dataframe-sql';
6+
17
/**
28
* Supported integration types
39
*/

0 commit comments

Comments
 (0)