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: unique schema type for `StreamMediaOutput` (#5387)
Akshay Agrawal904e7c26ff4d
diff --git a/marimo/_schemas/generated/session.yaml b/marimo/_schemas/generated/session.yamlindex 95c58b5f20..fdfdf5bb9d 100644--- a/marimo/_schemas/generated/session.yaml+++ b/marimo/_schemas/generated/session.yaml@@ -115,7 +115,7 @@ components:type: stringtype:enum:- - stream+ - streamMediatype: stringrequired:- typediff --git a/marimo/_schemas/session.py b/marimo/_schemas/session.pyindex d61a3c6d16..4637dfa4c5 100644--- a/marimo/_schemas/session.py+++ b/marimo/_schemas/session.py@@ -1,4 +1,13 @@# Copyright 2025 Marimo. All rights reserved.+"""This file contains the schema for the notebook session.++It may be externally used and must be kept backwards compatible.++* We generate the OpenAPI schema using a marimo notebook: `python scripts/generate_schemas.py`+* We generate frontend types using `make fe-codegen`+* We check for backwards compatibility using a GitHub action: `.github/workflows/test_schemas.yaml`+"""+from __future__ import annotationsfrom typing import Any, Literal, Optional, Union@@ -6,13 +15,6 @@ from typing import Any, Literal, Optional, Unionfrom marimo._messaging.mimetypes import KnownMimeTypefrom marimo._schemas.common import BaseDict-# This file contains the schema for the notebook session.-# It may be externally used and must be kept backwards compatible.-#-# We generate the OpenAPI schema using a marimo notebook: `python scripts/generate_schemas.py`-# We generate frontend types using `make fe-codegen`-# We check for backwards compatibility using a GitHub action: `.github/workflows/test_schemas.yaml`-# Metadata typesclass TimeMetadata(BaseDict):@@ -22,6 +24,8 @@ class TimeMetadata(BaseDict):# Output types+#+# NB: No two outputs can have the same `type` field.class StreamOutput(BaseDict):type: Literal["stream"]name: Literal["stdout", "stderr"]@@ -29,7 +33,7 @@ class StreamOutput(BaseDict):class StreamMediaOutput(BaseDict):- type: Literal["stream"]+ type: Literal["streamMedia"]name: Literal["media"]data: strmimetype: KnownMimeTypediff --git a/marimo/_server/session/serialize.py b/marimo/_server/session/serialize.pyindex c9d30bc840..945927d15c 100644--- a/marimo/_server/session/serialize.py+++ b/marimo/_server/session/serialize.py@@ -95,7 +95,7 @@ def serialize_session_view(view: SessionView) -> NotebookSessionV1:if console_out.channel == CellChannel.MEDIA:console.append(StreamMediaOutput(- type="stream",+ type="streamMedia",name="media",mimetype=console_out.mimetype,data=str(console_out.data),diff --git a/openapi/src/session.ts b/openapi/src/session.tsindex d2259dc20b..88f1c0498a 100644--- a/openapi/src/session.ts+++ b/openapi/src/session.ts@@ -68,7 +68,7 @@ export interface components {/** @enum {string} */name: "media";/** @enum {string} */- type: "stream";+ type: "streamMedia";};StreamOutput: {/** @enum {string} */