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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: dont close an already closed websocket with mo.mpl.interactive (#1861)
Myles Scolnickbbe642e96a06
diff --git a/marimo/_plugins/stateless/mpl/_mpl.py b/marimo/_plugins/stateless/mpl/_mpl.pyindex 0ab2e538c1..b4bb0b2676 100644--- a/marimo/_plugins/stateless/mpl/_mpl.py+++ b/marimo/_plugins/stateless/mpl/_mpl.py@@ -17,6 +17,8 @@ import timefrom pathlib import Pathfrom typing import TYPE_CHECKING, Any, Optional, Tuple+from starlette.websockets import WebSocketState+from marimo._output.builder import hfrom marimo._output.hypertext import Htmlfrom marimo._output.rich_help import mddoc@@ -142,7 +144,8 @@ def create_application(except Exception:passfinally:- await websocket.close()+ if websocket.application_state != WebSocketState.DISCONNECTED:+ await websocket.close()async def send() -> None:try:@@ -155,7 +158,8 @@ def create_application(except Exception:passfinally:- await websocket.close()+ if websocket.application_state != WebSocketState.DISCONNECTED:+ await websocket.close()await asyncio.gather(receive(), send())