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.

improvement: let user know to restart the notebook to enable duckdb (#1887)

Myles Scolnick1d676ff8d140
diff --git a/frontend/src/components/editor/notebook-banner.tsx b/frontend/src/components/editor/notebook-banner.tsx
index a91146953f..c6fbeae8b1 100644
--- a/frontend/src/components/editor/notebook-banner.tsx
+++ b/frontend/src/components/editor/notebook-banner.tsx
@@ -3,7 +3,7 @@ import { useBanners, useBannersActions } from "@/core/errors/state";
import { renderHTML } from "@/plugins/core/RenderHTML";
import { Banner } from "@/plugins/impl/common/error-banner";
import { AlertCircleIcon, RotateCcwIcon, XIcon } from "lucide-react";
-import React from "react";
+import type React from "react";
import { Button } from "../ui/button";
import { useRestartKernel } from "./actions/useRestartKernel";
@@ -53,10 +53,10 @@ const RestartSessionButton = () => {
<Button
data-testid="restart-session-button"
variant="link"
- size="sm"
+ size="xs"
onClick={restartKernel}
>
- <RotateCcwIcon className="w-4 h-4 mr-2" />
+ <RotateCcwIcon className="w-3 h-3 mr-2" />
Restart
</Button>
);
diff --git a/frontend/src/components/editor/renderers/CellArray.tsx b/frontend/src/components/editor/renderers/CellArray.tsx
index 7535e3e73a..de6619ecd3 100644
--- a/frontend/src/components/editor/renderers/CellArray.tsx
+++ b/frontend/src/components/editor/renderers/CellArray.tsx
@@ -191,10 +191,15 @@ const AddCellButtons: React.FC = () => {
<Tooltip
content={
sqlCapabilities ? null : (
- <span>
- Requires duckdb:{" "}
- <Kbd className="inline">pip install duckdb</Kbd>
- </span>
+ <div className="flex flex-col">
+ <span>
+ Requires duckdb:{" "}
+ <Kbd className="inline">pip install duckdb</Kbd>.
+ </span>
+ <span>
+ You will need to restart the notebook after installing.
+ </span>
+ </div>
)
}
delayDuration={100}
diff --git a/marimo/_server/api/endpoints/ws.py b/marimo/_server/api/endpoints/ws.py
index abea49fa0c..5cfb1458a7 100644
--- a/marimo/_server/api/endpoints/ws.py
+++ b/marimo/_server/api/endpoints/ws.py
@@ -249,6 +249,7 @@ class WebsocketHandler(SessionConsumer):
Banner(
title="Reconnected",
description="You have reconnected to an existing session.",
+ action="restart",
)
)