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: Support Format for more `Bokeh` objects (#3910)

WayZerf78d1d2d8768
diff --git a/marimo/_output/formatters/bokeh_formatters.py b/marimo/_output/formatters/bokeh_formatters.py
index fc19e05047..f6f0bcc965 100644
--- a/marimo/_output/formatters/bokeh_formatters.py
+++ b/marimo/_output/formatters/bokeh_formatters.py
@@ -54,9 +54,10 @@ class BokehFormatter(FormatterFactory):
bokeh.plotting.show = old_show
bokeh.plotting.output_notebook = old_output_notebook
- @formatting.formatter(bokeh.models.Plot)
+ @formatting.formatter(bokeh.models.Model)
+ @formatting.formatter(bokeh.document.Document)
def _show_plot(
- plot: bokeh.models.Plot,
+ plot: bokeh.models.Model | bokeh.document.Document,
) -> tuple[KnownMimeType, str]:
import bokeh.embed # type: ignore[import-not-found,import-untyped,unused-ignore] # noqa: E501
import bokeh.resources # type: ignore[import-not-found,import-untyped,unused-ignore] # noqa: E501