Skip to content

feat: support SQL cells and pin dependencies in notebooks #74

Open
peter-gy wants to merge 6 commits into
marimo-team:mainfrom
peter-gy:ptr/sql-support
Open

feat: support SQL cells and pin dependencies in notebooks #74
peter-gy wants to merge 6 commits into
marimo-team:mainfrom
peter-gy:ptr/sql-support

Conversation

@peter-gy
Copy link
Copy Markdown
Contributor

@peter-gy peter-gy commented May 6, 2026

Summary

The current https://marimo-team.github.io/quarto-marimo/ deployment omits the SQL tutorial. This PR adds support for sql cells and also ensures that the example notebook is Pyodide-compatible (uses pandas to read remote CSV instead of DuckDB which has no wasm build for HTTPFS ext).

Updates marimo copyright year as well to 2026.

Also fixes the plot tutorial notebook layout:

Current GH Pages
Screenshot 2026-05-06 at 14 08 32

Fixed nb from localhost
Screenshot 2026-05-06 at 14 09 12

Checklist

  • Any AI-generated code has been reviewed line-by-line by the human PR author.
  • Tests have been added or updated for the changes (where applicable).
  • make lint and make test pass locally.
  • Documentation / tutorials updated where relevant.

Copilot AI review requested due to automatic review settings May 6, 2026 12:10
@peter-gy peter-gy changed the title feat: add SQL cell support and pin dependencies in notebooks feat: support SQL cells and pin dependencies in notebooks May 6, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Quarto-marimo tutorial site to include the SQL tutorial again by adding SQL marimo-cell support in the engine/extractor, and updates multiple tutorials to marimo 0.23.1 with pinned (Pyodide-friendly) dependencies via pyproject frontmatter.

Changes:

  • Add SQL marimo-cell detection (TS) and SQL→Python conversion during extraction (Python) so SQL cells can execute in the marimo engine flow.
  • Update tutorials’ frontmatter (marimo version, headers, pyproject dependencies) and re-add SQL tutorial to navigation/rendering.
  • Adjust project rendering configuration (_quarto.yml, make render) to render the whole project.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tutorials/ui.qmd Update marimo version/header and minor formatting changes.
tutorials/sql.qmd Add pyproject dependencies and Pyodide-friendly CSV loading; tutorial formatting tweaks.
tutorials/plots.qmd Add pyproject dependencies/header; update marimo version and formatting.
tutorials/markdown.qmd Add pyproject dependencies/header; update marimo version and formatting.
tutorials/markdown_format.qmd Add pyproject dependencies/header; update marimo version and formatting.
tutorials/layout.qmd Update marimo version/header and formatting.
tutorials/intro.qmd Update marimo version/header and formatting.
tutorials/index.qmd Add copyright header; add SQL tutorial link; fix for-jupyter-users link.
tutorials/for_jupyter_users.qmd Update marimo version/header and formatting.
tutorials/fileformat.qmd Update marimo version/header; convert admonition syntax; formatting tweaks.
tutorials/external_dependencies.qmd Add copyright header.
tutorials/example-pdf.qmd Add copyright header.
tutorials/dataflow.qmd Add pyproject dependencies/header; update marimo version and formatting.
tests/python/test_extract.py Add unit tests for SQL conversion helper; update marimo-version stripping test.
tests/is-marimo-cell.test.ts Add tests covering SQL marimo-cell detection.
tests/cell-execution-regex.test.ts Add tests covering SQL fence regex variants.
Makefile Make render run full quarto render; add preview to .PHONY.
lib/is-marimo-cell.ts Recognize SQL marimo-cell languages (sql, sql.marimo).
lib/cell-execution-regex.ts Extend marimo fence regex to match SQL variants.
_quarto.yml Ensure tutorials (including SQL) are rendered; add SQL tutorial to sidebar.
_extensions/marimo/extract.py Add SQL→Python conversion and apply it during pandoc export generation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread _extensions/marimo/extract.py Outdated
Comment thread _extensions/marimo/extract.py
Comment thread tutorials/sql.qmd
Comment thread Makefile
Comment thread tests/python/test_extract.py
Comment thread Makefile

render:
quarto render tutorials/intro.qmd --to html
quarto render
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ensures that the config defined in _quarto.yml will be used to determine how to render full project.

Comment thread tutorials/sql.qmd
Comment on lines +338 to +340
CREATE OR replace TABLE cars as (
SELECT * FROM cars_df
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DuckDB HTTPFS extension has no wasm build, so the remote CSV read will always err. to work around that, we load cars_df via a pd.read_csv call, because that's our most stable bet in Pyodide for fetching remote data.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can potentially patch for duckdb, we do a few other select patches: marimo-team/marimo#9413

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh that would make a lot of sense. I'll take a stab at it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Comment thread tutorials/sql.qmd
Comment thread Makefile
@peter-gy peter-gy requested a review from dmadisetti May 6, 2026 12:42
Copy link
Copy Markdown
Collaborator

@dmadisetti dmadisetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple qs! But thanks! Looks like an oversight

Comment thread _extensions/marimo/extract.py Outdated
Comment thread lib/cell-execution-regex.ts
Comment thread _extensions/marimo/extract.py Outdated
@peter-gy peter-gy requested a review from dmadisetti May 6, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants