Skip to content

bug: marimo WASM ddd_tour notebook broken — polars import crashes pyodide #644

@paddymul

Description

@paddymul

Summary

The marimo WASM notebook at /example_notebooks/buckaroo_ddd_tour/ is completely broken. The page loads but renders nothing.

Root cause

buckaroo_ddd_tour.py has a cell that calls ddd.pl_df_with_weird_types_as_pandas(), which internally does import polars as pl (ddd_library.py:179). Polars has no pyodide/WASM wheel, so this cell crashes at runtime in the browser.

The failure cascades through marimo's reactive dependency graph:

  1. pl_df_with_weird_types cell errors → pl_df_with_weird_types_config is never defined
  2. The dropdown aggregator cell lists pl_df_with_weird_types_config as a required parameter → can't run → dropdown_dict is never defined
  3. The main display cell depends on dropdown_dict → can't render

One broken cell poisons the entire notebook — even the cells that don't touch polars.

Introduced in

PR #641 added pl_df_with_weird_types / pl_df_with_weird_types_as_pandas to ddd_library.py and wired them into buckaroo_ddd_tour.py.

Why tests didn't catch it

  • WASM Playwright tests only cover buckaroo_simple.py, not buckaroo_ddd_tour.py (full WASM suite deferred per Re-enable full WASM marimo Playwright test suite #513)
  • Python unit tests run in CPython where polars is installed — ddd_library.py works fine natively
  • RTD build generates the HTML but never runs it in a browser
  • The polars import is inside a function body, so it passes static analysis and all native tests

Possible fixes

  • Exclude the pl_df_with_weird_types cell from the WASM notebook (simplest)
  • Guard with try/except ImportError so the cell gracefully degrades instead of crashing
  • Make the dropdown aggregator not depend on pl_df_with_weird_types_config (break the cascade)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions