Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/kernel-metadata-fallback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Fallback kernel metadata to use until the .deepnote file format includes kernel information
export const kernelMetadataFallback = {
kernelspec: {
display_name: 'Python 3 (ipykernel)',
language: 'python',
name: 'python3'
},
language_info: {
codemirror_mode: {
name: 'ipython',
version: 3
},
file_extension: '.py',
mimetype: 'text/x-python',
name: 'python',
nbconvert_exporter: 'python',
pygments_lexer: 'ipython3',
version: '3.12.11'
}
};
2 changes: 2 additions & 0 deletions src/transform-deepnote-yaml-to-notebook-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { IDeepnoteNotebookContent, IDeepnoteNotebookMetadata } from './types';
import { blankCodeCell, blankDeepnoteNotebookContent } from './fallback-data';
import { deserializeDeepnoteFile } from '@deepnote/blocks';
import { convertDeepnoteBlockToJupyterCell } from './convert-deepnote-block-to-jupyter-cell';
import { kernelMetadataFallback } from './kernel-metadata-fallback';

export async function transformDeepnoteYamlToNotebookContent(
yamlString: string
Expand Down Expand Up @@ -42,6 +43,7 @@ export async function transformDeepnoteYamlToNotebookContent(
return {
cells,
metadata: {
...kernelMetadataFallback,
deepnote: {
notebooks
}
Expand Down
Loading