Skip to content

Commit 3db00b1

Browse files
feat: add kernel metadata fallback
Signed-off-by: Andy Jakubowski <[email protected]>
1 parent ea98a58 commit 3db00b1

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/kernel-metadata-fallback.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Fallback kernel metadata to use until the .deepnote file format includes kernel information
2+
export const kernelMetadataFallback = {
3+
kernelspec: {
4+
display_name: 'Python 3 (ipykernel)',
5+
language: 'python',
6+
name: 'python3'
7+
},
8+
language_info: {
9+
codemirror_mode: {
10+
name: 'ipython',
11+
version: 3
12+
},
13+
file_extension: '.py',
14+
mimetype: 'text/x-python',
15+
name: 'python',
16+
nbconvert_exporter: 'python',
17+
pygments_lexer: 'ipython3',
18+
version: '3.12.11'
19+
}
20+
};

src/transform-deepnote-yaml-to-notebook-content.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { IDeepnoteNotebookContent, IDeepnoteNotebookMetadata } from './types';
22
import { blankCodeCell, blankDeepnoteNotebookContent } from './fallback-data';
33
import { deserializeDeepnoteFile } from '@deepnote/blocks';
44
import { convertDeepnoteBlockToJupyterCell } from './convert-deepnote-block-to-jupyter-cell';
5+
import { kernelMetadataFallback } from './kernel-metadata-fallback';
56

67
export async function transformDeepnoteYamlToNotebookContent(
78
yamlString: string
@@ -42,6 +43,7 @@ export async function transformDeepnoteYamlToNotebookContent(
4243
return {
4344
cells,
4445
metadata: {
46+
...kernelMetadataFallback,
4547
deepnote: {
4648
notebooks
4749
}

0 commit comments

Comments
 (0)