Skip to content

Commit 402f077

Browse files
committed
refactor: Remove debug logs and refine metadata parsing in Deepnote converters
1 parent 01569a0 commit 402f077

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/notebooks/deepnote/converters/inputConverters.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ export abstract class BaseInputBlockConverter<T extends z.ZodObject> implements
5151

5252
convertToCell(block: DeepnoteBlock): NotebookCellData {
5353
const deepnoteJupyterRawContentResult = z.string().safeParse(block.metadata?.[DEEPNOTE_VSCODE_RAW_CONTENT_KEY]);
54-
const deepnoteBigNumberMetadataResult = this.schema().safeParse(block.metadata);
54+
const deepnoteMetadataResult = this.schema().safeParse(block.metadata);
5555

56-
if (deepnoteBigNumberMetadataResult.error != null) {
57-
console.error('Error parsing deepnote big number metadata:', deepnoteBigNumberMetadataResult.error);
56+
if (deepnoteMetadataResult.error != null) {
57+
console.error('Error parsing deepnote input metadata:', deepnoteMetadataResult.error);
5858
console.debug('Metadata:', JSON.stringify(block.metadata));
5959
}
6060

6161
const configStr = deepnoteJupyterRawContentResult.success
6262
? deepnoteJupyterRawContentResult.data
63-
: deepnoteBigNumberMetadataResult.success
64-
? JSON.stringify(deepnoteBigNumberMetadataResult.data, null, 2)
65-
: JSON.stringify(this.defaultConfig());
63+
: deepnoteMetadataResult.success
64+
? JSON.stringify(deepnoteMetadataResult.data, null, 2)
65+
: JSON.stringify(this.defaultConfig(), null, 2);
6666

6767
const cell = new NotebookCellData(NotebookCellKind.Code, configStr, 'json');
6868
console.log(cell);

src/notebooks/deepnote/deepnoteDataConverter.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export class DeepnoteDataConverter {
5252
*/
5353
convertBlocksToCells(blocks: DeepnoteBlock[]): NotebookCellData[] {
5454
return blocks.map((block) => {
55-
console.log('blockType:', block.type);
56-
console.log('registry:', this.registry.listSupportedTypes());
5755
const converter = this.registry.findConverter(block.type);
5856

5957
if (!converter) {

src/notebooks/deepnote/deepnoteSchemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const DeepnoteSliderInputMetadataSchema = z.object({
132132
.nullish()
133133
.transform((val) => val ?? null),
134134
deepnote_variable_value: z
135-
.union([z.string(), z.number()])
135+
.string()
136136
.nullish()
137137
.transform((val) => val ?? null),
138138
deepnote_slider_min_value: z

0 commit comments

Comments
 (0)