Skip to content

docs: standardize supported dataframe backends across UI elements#9583

Merged
mscolnick merged 1 commit into
mainfrom
ms/dataframe-docs-and-tests
May 19, 2026
Merged

docs: standardize supported dataframe backends across UI elements#9583
mscolnick merged 1 commit into
mainfrom
ms/dataframe-docs-and-tests

Conversation

@mscolnick

@mscolnick mscolnick commented May 18, 2026

Copy link
Copy Markdown
Contributor

Closes #9081

Resolves docstring inconsistencies flagged in #9081 by using a uniform
non-exhaustive phrasing — (e.g., Polars, Pandas, PyArrow, Ibis, DuckDB)
across mo.ui.table, mo.ui.dataframe, mo.ui.data_explorer,
mo.ui.altair_chart, and docs/api/inputs/dataframe.md. mo.ui.data_editor
is documented as eager-only since _apply_edits_dataframe uses narwhals'
eager_only=True. mo.ui.table.lazy lists Polars LazyFrame, Ibis Table,
and DuckDB Relation.

Also fixes a data_editor bug where _convert_value deepcopied the input
unconditionally — DuckDBPyRelation is not picklable. The deepcopy is only
needed for the list/dict paths (they mutate in place); the dataframe path
constructs a new native frame via narwhals.

Closes coverage gaps by removing 10 exclude=["pyarrow", "duckdb", "lazy-polars"] sites in the mo.ui.dataframe tests and one
exclude=["duckdb"] in the table bin-values test, plus adding parametrized
smoke tests for mo.ui.data_editor and mo.ui.dataframe.

Resolves docstring inconsistencies flagged in #9081 by using a uniform
non-exhaustive phrasing — `(e.g., Polars, Pandas, PyArrow, Ibis, DuckDB)` —
across `mo.ui.table`, `mo.ui.dataframe`, `mo.ui.data_explorer`,
`mo.ui.altair_chart`, and `docs/api/inputs/dataframe.md`. `mo.ui.data_editor`
is documented as eager-only since `_apply_edits_dataframe` uses narwhals'
`eager_only=True`. `mo.ui.table.lazy` lists Polars LazyFrame, Ibis Table,
and DuckDB Relation.

Also fixes a `data_editor` bug where `_convert_value` deepcopied the input
unconditionally — `DuckDBPyRelation` is not picklable. The deepcopy is only
needed for the list/dict paths (they mutate in place); the dataframe path
constructs a new native frame via narwhals.

Closes coverage gaps by removing 10 `exclude=["pyarrow", "duckdb",
"lazy-polars"]` sites in the `mo.ui.dataframe` tests and one
`exclude=["duckdb"]` in the table bin-values test, plus adding parametrized
smoke tests for `mo.ui.data_editor` and `mo.ui.dataframe`.
Copilot AI review requested due to automatic review settings May 18, 2026 17:47
@mscolnick mscolnick requested a review from akshayka as a code owner May 18, 2026 17:47
@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment May 18, 2026 6:55pm

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 18, 2026
data = self._data
if isinstance(data, (list, dict)):
data = deepcopy(data)
return apply_edits(data, value)

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.

small correctness fix when enabling more tests

@mscolnick mscolnick requested a review from kirangadhave May 18, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Standardizes the docstring phrasing for supported dataframe backends across the dataframe-accepting UI elements, fixes a data_editor._convert_value bug where unconditional deepcopy broke non-picklable inputs like DuckDBPyRelation, and expands parametrized test coverage to additional backends (PyArrow, DuckDB, lazy Polars) where applicable.

Changes:

  • Uniform docstring wording (e.g., Polars, Pandas, PyArrow, Ibis, DuckDB) for table, dataframe, data_explorer, altair_chart, and data_editor (eager-only); table.lazy lists lazy backends.
  • data_editor._convert_value only deepcopies for list/dict inputs; dataframe inputs are passed through to narwhals.
  • Removed many exclude=[...] parametrize narrowings in dataframe tests and the bin-values null test; added new parametrized backend coverage tests for data_editor and dataframe.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
marimo/_plugins/ui/_impl/table.py Standardized table data sources docstring; updated lazy to mention Polars/Ibis/DuckDB lazy types.
marimo/_plugins/ui/_impl/dataframes/dataframe.py Standardized supported-backends wording.
marimo/_plugins/ui/_impl/data_explorer.py Standardized df arg docstring.
marimo/_plugins/ui/_impl/altair_chart.py Standardized supported-backends wording (now also lists Ibis/DuckDB).
marimo/_plugins/ui/_impl/data_editor.py Eager-only docstring; skip deepcopy for dataframe path to support non-picklable frames.
docs/api/inputs/dataframe.md Updated install note to reference any supported dataframe library.
tests/_plugins/ui/_impl/test_table.py Dropped exclude=["duckdb"] in bin-values null test.
tests/_plugins/ui/_impl/test_data_editor.py Added parametrized backend coverage for eager backends.
tests/_plugins/ui/_impl/dataframes/test_dataframe.py Added round-trip backend test; removed many backend exclusions; added pyarrow/duckdb expected schema variant.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 9 files

Architecture diagram
sequenceDiagram
    participant UI as UI Element
    participant Table as mo.ui.table
    participant LazyTable as mo.ui.table.lazy
    participant DataEditor as mo.ui.data_editor
    participant DFExplorer as mo.ui.data_explorer
    participant AltairChart as mo.ui.altair_chart
    participant DataFrame as mo.ui.dataframe
    participant Narwhals as Narwhals Library
    participant Backend as Dataframe Backend

    Note over UI,Backend: Supported dataframe backends across all UI elements

    UI->>DataFrame: Create with dataframe
    DataFrame->>Narwhals: Convert to narwhals type
    Narwhals-->>DataFrame: Generic dataframe wrapper
    DataFrame->>Backend: Support Polars, Pandas, PyArrow, Ibis, DuckDB
    Backend-->>DataFrame: Native dataframe operations

    UI->>Table: Create with dataframe
    Table->>Narwhals: Convert to narwhals type
    Narwhals-->>Table: Generic dataframe wrapper
    Table->>Backend: Support Polars, Pandas, PyArrow, Ibis, DuckDB

    UI->>LazyTable: Create with lazy dataframe
    LazyTable->>Backend: Support Polars LazyFrame, Ibis Table, DuckDB Relation

    UI->>DataEditor: Create with eager dataframe
    DataEditor->>DataEditor: Check input type
    alt Input is list or dict
        DataEditor->>DataEditor: deepcopy for mutation safety
    else Input is dataframe
        DataEditor->>DataEditor: Skip deepcopy (not picklable for some backends)
        DataEditor->>Narwhals: Apply edits with eager_only=True
        Narwhals-->>DataEditor: New native dataframe
    end
    DataEditor-->>UI: Edited result

    UI->>DFExplorer: Create with dataframe
    DFExplorer->>Backend: Support Polars, Pandas, PyArrow, Ibis, DuckDB

    UI->>AltairChart: Create with dataframe
    AltairChart->>Backend: Support Polars, Pandas, PyArrow, Ibis, DuckDB

    Note over DataFrame: Construction round-trips to original type
    DataFrame->>Backend: Native backend
    Backend-->>DataFrame: Original type preserved

    Note over DataEditor: Edit operations produce same type
    UI->>DataEditor: Apply edit
    DataEditor->>Narwhals: Convert and apply with eager_only=True
    Narwhals-->>DataEditor: New dataframe
    alt Eager backend (Polars, Pandas, PyArrow)
        DataEditor-->>UI: Output same type as input
    else Lazy/relation backend (Ibis, DuckDB)
        Note over DataEditor: Not supported (throws error)
    end
Loading

Re-trigger cubic

@kirangadhave kirangadhave left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

@mscolnick mscolnick merged commit 1c7c29a into main May 19, 2026
49 of 50 checks passed
@mscolnick mscolnick deleted the ms/dataframe-docs-and-tests branch May 19, 2026 18:19
@github-actions

Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.7-dev55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation around supported table types when class accepts narwhals.typing.IntoDataFrame

3 participants