Skip to content

Commit bc5b9ef

Browse files
committed
show duckdb integration
1 parent f61e38f commit bc5b9ef

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/notebooks/deepnote/sqlCellStatusBarProvider.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
9191

9292
// Add integration status bar item if integration ID is present
9393
const integrationId = this.getIntegrationId(cell);
94-
if (integrationId && integrationId !== DATAFRAME_SQL_INTEGRATION_ID) {
94+
if (integrationId) {
9595
const integrationItem = await this.createIntegrationStatusBarItem(cell, integrationId);
9696
if (integrationItem) {
9797
items.push(integrationItem);
@@ -108,6 +108,15 @@ export class SqlCellStatusBarProvider implements NotebookCellStatusBarItemProvid
108108
cell: NotebookCell,
109109
integrationId: string
110110
): Promise<NotebookCellStatusBarItem | undefined> {
111+
// Handle internal DuckDB integration specially
112+
if (integrationId === DATAFRAME_SQL_INTEGRATION_ID) {
113+
return {
114+
text: `$(database) ${l10n.t('DataFrame SQL (DuckDB)')}`,
115+
alignment: 1, // NotebookCellStatusBarAlignment.Left
116+
tooltip: l10n.t('Internal DuckDB integration for querying DataFrames')
117+
};
118+
}
119+
111120
const projectId = cell.notebook.metadata?.deepnoteProjectId;
112121
if (!projectId) {
113122
return undefined;

src/notebooks/deepnote/sqlCellStatusBarProvider.unit.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ suite('SqlCellStatusBarProvider', () => {
5656
assert.strictEqual(variableItem.command.command, 'deepnote.updateSqlVariableName');
5757
});
5858

59-
test('returns only variable status bar item for SQL cells with dataframe integration ID', async () => {
59+
test('returns status bar items for SQL cells with dataframe integration ID', async () => {
6060
const cell = createMockCell('sql', {
6161
sql_integration_id: DATAFRAME_SQL_INTEGRATION_ID
6262
});
@@ -66,10 +66,17 @@ suite('SqlCellStatusBarProvider', () => {
6666
assert.isDefined(result);
6767
assert.isArray(result);
6868
const items = result as any[];
69-
assert.strictEqual(items.length, 1);
69+
assert.strictEqual(items.length, 2);
70+
71+
// Check integration status bar item
72+
const integrationItem = items[0];
73+
assert.strictEqual(integrationItem.text, '$(database) DataFrame SQL (DuckDB)');
74+
assert.strictEqual(integrationItem.alignment, 1);
75+
assert.strictEqual(integrationItem.tooltip, 'Internal DuckDB integration for querying DataFrames');
76+
assert.isUndefined(integrationItem.command);
7077

7178
// Check variable status bar item
72-
const variableItem = items[0];
79+
const variableItem = items[1];
7380
assert.strictEqual(variableItem.text, 'Variable: df');
7481
assert.strictEqual(variableItem.alignment, 1);
7582
assert.isDefined(variableItem.command);

0 commit comments

Comments
 (0)