Skip to content

Commit cb75865

Browse files
committed
fix loading of integration list
1 parent fdc914b commit cb75865

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/notebooks/deepnote/integrations/integrationManager.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,24 @@ export class IntegrationManager implements IIntegrationManager {
174174
const blocksWithIntegrations: BlockWithIntegration[] = [];
175175

176176
for (const cell of notebook.getCells()) {
177-
const deepnoteMetadata = cell.metadata?.deepnoteMetadata;
178-
logger.trace(`IntegrationManager: Cell ${cell.index} metadata:`, deepnoteMetadata);
179-
180-
if (deepnoteMetadata?.sql_integration_id) {
181-
blocksWithIntegrations.push({
182-
id: `cell-${cell.index}`,
183-
sql_integration_id: deepnoteMetadata.sql_integration_id
184-
});
177+
const metadata = cell.metadata;
178+
logger.trace(`IntegrationManager: Cell ${cell.index} metadata:`, metadata);
179+
180+
// Check cell metadata for sql_integration_id
181+
if (metadata && typeof metadata === 'object') {
182+
const integrationId = (metadata as Record<string, unknown>).sql_integration_id;
183+
if (typeof integrationId === 'string') {
184+
logger.debug(`IntegrationManager: Found integration ${integrationId} in cell ${cell.index}`);
185+
blocksWithIntegrations.push({
186+
id: `cell-${cell.index}`,
187+
sql_integration_id: integrationId
188+
});
189+
}
185190
}
186191
}
187192

193+
logger.debug(`IntegrationManager: Found ${blocksWithIntegrations.length} cells with integrations`);
194+
188195
// Use the shared utility to scan blocks and build the status map
189196
return scanBlocksForIntegrations(blocksWithIntegrations, this.integrationStorage, 'IntegrationManager');
190197
}

0 commit comments

Comments
 (0)