Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: nans allowed in column summaries (#4272)

Akshay Agrawal11544b90fd73
diff --git a/frontend/src/components/data-table/renderers.tsx b/frontend/src/components/data-table/renderers.tsx
index d6334ba411..0605b2def2 100644
--- a/frontend/src/components/data-table/renderers.tsx
+++ b/frontend/src/components/data-table/renderers.tsx
@@ -98,6 +98,8 @@ export function renderTableBody<TData>(
row.toggleSelected();
}
}}
+ // These classes ensure that empty rows (nulls) still render
+ className="border-t h-6"
>
{renderCells(row, row.getLeftVisibleCells())}
{renderCells(row, row.getCenterVisibleCells())}
diff --git a/frontend/src/plugins/impl/DataTablePlugin.tsx b/frontend/src/plugins/impl/DataTablePlugin.tsx
index 932f556801..a28c786292 100644
--- a/frontend/src/plugins/impl/DataTablePlugin.tsx
+++ b/frontend/src/plugins/impl/DataTablePlugin.tsx
@@ -161,8 +161,8 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
summaries: z.array(
z.object({
column: z.union([z.number(), z.string()]),
- min: z.union([z.number(), z.string()]).nullish(),
- max: z.union([z.number(), z.string()]).nullish(),
+ min: z.union([z.number(), z.nan(), z.string()]).nullish(),
+ max: z.union([z.number(), z.nan(), z.string()]).nullish(),
unique: z.union([z.number(), z.array(z.any())]).nullish(),
nulls: z.number().nullish(),
true: z.number().nullish(),