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.

[pre-commit.ci] pre-commit autoupdate (#10578)

pre-commit-ci[bot]96a4942b87a3
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index cd6c0dbb1b..d60b351721 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -13,7 +13,7 @@ repos:
args: [-ignore, SC]
- repo: https://github.com/abravalheri/validate-pyproject
- rev: v0.25
+ rev: '0.26'
hooks:
- id: validate-pyproject
@@ -39,7 +39,7 @@ repos:
types: [python]
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.16.2
+ rev: v0.16.4
hooks:
# Run the linter
- id: ruff-check
@@ -56,7 +56,7 @@ repos:
# files: ^(frontend/src/|packages/)
- repo: https://github.com/oxc-project/mirrors-oxfmt
- rev: v0.45.0
+ rev: v0.65.0
hooks:
- id: oxfmt
args: [--write, --config, .oxfmtrc.json]
diff --git a/frontend/src/components/chat/acp/agent-panel.tsx b/frontend/src/components/chat/acp/agent-panel.tsx
index 7b018e7674..ed0eab01cf 100644
--- a/frontend/src/components/chat/acp/agent-panel.tsx
+++ b/frontend/src/components/chat/acp/agent-panel.tsx
@@ -334,12 +334,10 @@ const PromptArea = memo<PromptAreaProps>(
// sentence has to begin with '/' to trigger autocomplete
return {
triggerCompletionRegex: /^\/(\w+)?/,
- completions: commands.map(
- (prompt): Completion => ({
- label: `/${prompt.name}`,
- info: prompt.description,
- }),
- ),
+ completions: commands.map((prompt): Completion => ({
+ label: `/${prompt.name}`,
+ info: prompt.description,
+ })),
};
}, [commands]);
diff --git a/frontend/src/components/data-table/columns.tsx b/frontend/src/components/data-table/columns.tsx
index 1bd6793a44..233030fafa 100644
--- a/frontend/src/components/data-table/columns.tsx
+++ b/frontend/src/components/data-table/columns.tsx
@@ -196,150 +196,148 @@ export function generateColumns<T>({
columnKeys.splice(indexColumnIdx, 1);
}
- const columns = columnKeys.map(
- (key, idx): ColumnDef<T> => ({
- id: key || `${NAMELESS_COLUMN_PREFIX}${idx}`,
- // Use an accessorFn instead of an accessorKey because column names
- // may have periods in them ...
- // https://github.com/TanStack/table/issues/1671
- accessorFn: (row) => {
- return row[key as keyof T];
- },
- enableHiding: !rowHeadersSet.has(key) && key !== "",
- header: ({ column, table }) => {
- const stats = chartSpecModel?.getColumnStats(key);
- const dtype = column.columnDef.meta?.dtype;
- const headerTitle = headerTooltip?.[key];
- const headerJustify = textJustifyColumns?.[key];
-
- const dtypeHeader =
- showDataTypes && dtype ? (
- <div
- className={cn(
- "flex flex-row gap-1",
- headerJustify === "center" && "justify-center",
- headerJustify === "right" && "justify-end",
- )}
- >
- <span className="text-xs text-muted-foreground">{dtype}</span>
- {stats && typeof stats.nulls === "number" && stats.nulls > 0 && (
- <span className="text-xs text-muted-foreground">
- (nulls: {stats.nulls})
- </span>
- )}
- </div>
- ) : null;
-
- const headerName = (
- <span
+ const columns = columnKeys.map((key, idx): ColumnDef<T> => ({
+ id: key || `${NAMELESS_COLUMN_PREFIX}${idx}`,
+ // Use an accessorFn instead of an accessorKey because column names
+ // may have periods in them ...
+ // https://github.com/TanStack/table/issues/1671
+ accessorFn: (row) => {
+ return row[key as keyof T];
+ },
+ enableHiding: !rowHeadersSet.has(key) && key !== "",
+ header: ({ column, table }) => {
+ const stats = chartSpecModel?.getColumnStats(key);
+ const dtype = column.columnDef.meta?.dtype;
+ const headerTitle = headerTooltip?.[key];
+ const headerJustify = textJustifyColumns?.[key];
+
+ const dtypeHeader =
+ showDataTypes && dtype ? (
+ <div
className={cn(
- "font-bold",
- headerTitle && "underline decoration-dotted",
+ "flex flex-row gap-1",
+ headerJustify === "center" && "justify-center",
+ headerJustify === "right" && "justify-end",
)}
>
- {key === "" ? " " : key}
- </span>
- );
+ <span className="text-xs text-muted-foreground">{dtype}</span>
+ {stats && typeof stats.nulls === "number" && stats.nulls > 0 && (
+ <span className="text-xs text-muted-foreground">
+ (nulls: {stats.nulls})
+ </span>
+ )}
+ </div>
+ ) : null;
- const headerWithTooltip = headerTitle ? (
- <Tooltip content={headerTitle} delayDuration={300}>
- {headerName}
- </Tooltip>
- ) : (
- headerName
- );
+ const headerName = (
+ <span
+ className={cn(
+ "font-bold",
+ headerTitle && "underline decoration-dotted",
+ )}
+ >
+ {key === "" ? " " : key}
+ </span>
+ );
- const dataTableColumnHeader = (
- <DataTableColumnHeader
- header={headerWithTooltip}
- subheader={dtypeHeader}
- column={column}
- justify={headerJustify}
- calculateTopKRows={calculateTopKRows}
- table={table}
- />
- );
+ const headerWithTooltip = headerTitle ? (
+ <Tooltip content={headerTitle} delayDuration={300}>
+ {headerName}
+ </Tooltip>
+ ) : (
+ headerName
+ );
- // Row headers have no summaries
- if (rowHeadersSet.has(key)) {
- return dataTableColumnHeader;
- }
+ const dataTableColumnHeader = (
+ <DataTableColumnHeader
+ header={headerWithTooltip}
+ subheader={dtypeHeader}
+ column={column}
+ justify={headerJustify}
+ calculateTopKRows={calculateTopKRows}
+ table={table}
+ />
+ );
- return (
- <div
- className={cn(
- "flex flex-col h-full pt-0.5 pb-3 justify-between items-start",
- headerJustify === "center" && "items-center",
- headerJustify === "right" && "items-end",
- )}
- >
- {dataTableColumnHeader}
- <TableColumnSummary columnId={key} />
- </div>
- );
- },
+ // Row headers have no summaries
+ if (rowHeadersSet.has(key)) {
+ return dataTableColumnHeader;
+ }
- cell: ({ column, renderValue, getValue, cell }) => {
- function selectCell() {
- if (selection !== "single-cell" && selection !== "multi-cell") {
- return;
- }
+ return (
+ <div
+ className={cn(
+ "flex flex-col h-full pt-0.5 pb-3 justify-between items-start",
+ headerJustify === "center" && "items-center",
+ headerJustify === "right" && "items-end",
+ )}
+ >
+ {dataTableColumnHeader}
+ <TableColumnSummary columnId={key} />
+ </div>
+ );
+ },
- cell.toggleSelected?.();
+ cell: ({ column, renderValue, getValue, cell }) => {
+ function selectCell() {
+ if (selection !== "single-cell" && selection !== "multi-cell") {
+ return;
}
- const justify = getJustify(key);
- const wrapped = wrappedColumns?.includes(key);
- const isCellSelected = cell?.getIsSelected?.() || false;
- const canSelectCell =
- (selection === "single-cell" || selection === "multi-cell") &&
- !isCellSelected;
-
- const dataType = column.columnDef.meta?.dataType;
- const isNumeric = isNumericType(dataType);
- const cellStyles = getCellStyleClass({
- justify,
- wrapped,
- canSelectCell,
- isSelected: isCellSelected,
- isNumeric,
- });
-
- const renderedCell = renderCellValue({
- column,
- renderValue,
- getValue,
- selectCell,
- cellStyles,
- });
-
- // Row headers are bold
- if (rowHeadersSet.has(key)) {
- return <b>{renderedCell}</b>;
- }
+ cell.toggleSelected?.();
+ }
- return renderedCell;
- },
- // Remove any default filtering
- filterFn: undefined,
- // Unnamed index columns and geometry columns are not sortable
- enableSorting: !!key && getMeta(key).dataType !== "geometry",
- meta: {
- ...getMeta(key),
- width: columnWidths?.[key],
- },
- // size seeds the width before measurement; minSize/maxSize pin
- // getSize() to the fixed width so the per-paint measurement writeback
- // cannot drift the header width or sticky-pin offsets.
- ...(columnWidths?.[key] !== undefined
- ? {
- size: columnWidths[key],
- minSize: columnWidths[key],
- maxSize: columnWidths[key],
- }
- : {}),
- }),
- );
+ const justify = getJustify(key);
+ const wrapped = wrappedColumns?.includes(key);
+ const isCellSelected = cell?.getIsSelected?.() || false;
+ const canSelectCell =
+ (selection === "single-cell" || selection === "multi-cell") &&
+ !isCellSelected;
+
+ const dataType = column.columnDef.meta?.dataType;
+ const isNumeric = isNumericType(dataType);
+ const cellStyles = getCellStyleClass({
+ justify,
+ wrapped,
+ canSelectCell,
+ isSelected: isCellSelected,
+ isNumeric,
+ });
+
+ const renderedCell = renderCellValue({
+ column,
+ renderValue,
+ getValue,
+ selectCell,
+ cellStyles,
+ });
+
+ // Row headers are bold
+ if (rowHeadersSet.has(key)) {
+ return <b>{renderedCell}</b>;
+ }
+
+ return renderedCell;
+ },
+ // Remove any default filtering
+ filterFn: undefined,
+ // Unnamed index columns and geometry columns are not sortable
+ enableSorting: !!key && getMeta(key).dataType !== "geometry",
+ meta: {
+ ...getMeta(key),
+ width: columnWidths?.[key],
+ },
+ // size seeds the width before measurement; minSize/maxSize pin
+ // getSize() to the fixed width so the per-paint measurement writeback
+ // cannot drift the header width or sticky-pin offsets.
+ ...(columnWidths?.[key] !== undefined
+ ? {
+ size: columnWidths[key],
+ minSize: columnWidths[key],
+ maxSize: columnWidths[key],
+ }
+ : {}),
+ }));
if (selection === "single" || selection === "multi") {
columns.unshift({
diff --git a/frontend/src/core/codemirror/markdown/commands.ts b/frontend/src/core/codemirror/markdown/commands.ts
index 4c7ccf5e1f..55963c739c 100644
--- a/frontend/src/core/codemirror/markdown/commands.ts
+++ b/frontend/src/core/codemirror/markdown/commands.ts
@@ -41,7 +41,7 @@ function toggleAllLines({
}
}
- for (let pos = selection.from; pos <= selection.to; ) {
+ for (let pos = selection.from; pos <= selection.to;) {
const line = view.state.doc.lineAt(pos);
const lineText = line.text;
diff --git a/frontend/src/core/codemirror/markdown/completions.ts b/frontend/src/core/codemirror/markdown/completions.ts
index 57e77d0979..8faa44db8b 100644
--- a/frontend/src/core/codemirror/markdown/completions.ts
+++ b/frontend/src/core/codemirror/markdown/completions.ts
@@ -94,23 +94,21 @@ const getLucideIconList = once(async (): Promise<Completion[]> => {
return `https://cdn.jsdelivr.net/npm/[email protected]/icons/${iconName}.svg`;
};
- return Object.entries(iconList).map(
- ([iconName, aliases]): Completion => ({
- label: `::${iconName}`,
- displayLabel: iconName,
- type: "lucide-icon",
- boost: 10,
- apply: `::lucide:${iconName}::`,
- detail: aliases.join(", "),
- info: () => {
- const img = document.createElement("img");
- img.src = asSvg(iconName);
- img.style.width = "24px";
- img.style.height = "24px";
- return img;
- },
- }),
- );
+ return Object.entries(iconList).map(([iconName, aliases]): Completion => ({
+ label: `::${iconName}`,
+ displayLabel: iconName,
+ type: "lucide-icon",
+ boost: 10,
+ apply: `::lucide:${iconName}::`,
+ detail: aliases.join(", "),
+ info: () => {
+ const img = document.createElement("img");
+ img.src = asSvg(iconName);
+ img.style.width = "24px";
+ img.style.height = "24px";
+ return img;
+ },
+ }));
});
// Completion provider for LaTeX-style UTF-8 symbols