Skip to content
Merged
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/notebooks/deepnote/inputBlockContentFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* This is the single source of truth for how input block values are displayed in cells.
*/

import z from 'zod';

/**
* Gets the expected language ID for an input block type.
* This is the single source of truth for input block language modes.
Expand Down Expand Up @@ -57,7 +59,8 @@ export function formatInputBlockCellContent(blockType: string, metadata: Record<

case 'input-slider': {
const value = metadata.deepnote_variable_value;
return typeof value === 'number' ? String(value) : '';
const parsedValueResult = z.coerce.number().safeParse(value);
return parsedValueResult.success ? String(parsedValueResult.data) : '';
}

case 'input-checkbox': {
Expand Down
Loading