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
improvement: release data-editor out of experimental (#4470)
Myles Scolnick1a60ef12dbcb
diff --git a/marimo/_plugins/ui/__init__.py b/marimo/_plugins/ui/__init__.pyindex 6696cf2e2b..1043d12626 100644--- a/marimo/_plugins/ui/__init__.py+++ b/marimo/_plugins/ui/__init__.py@@ -13,6 +13,7 @@ __all__ = ["chat","checkbox","code_editor",+ "data_editor","data_explorer","dataframe","date_range",@@ -46,7 +47,8 @@ from marimo._plugins.ui._impl.array import arrayfrom marimo._plugins.ui._impl.batch import batchfrom marimo._plugins.ui._impl.chat.chat import chatfrom marimo._plugins.ui._impl.data_editor import (- data_editor as experimental_data_editor,+ data_editor,+ experimental_data_editor,)from marimo._plugins.ui._impl.data_explorer import data_explorerfrom marimo._plugins.ui._impl.dataframes.dataframe import dataframediff --git a/marimo/_plugins/ui/_impl/data_editor.py b/marimo/_plugins/ui/_impl/data_editor.pyindex 94f0d92926..04e7dc8ceb 100644--- a/marimo/_plugins/ui/_impl/data_editor.py+++ b/marimo/_plugins/ui/_impl/data_editor.py@@ -25,6 +25,7 @@ from marimo._output.rich_help import mddocfrom marimo._plugins.ui._core.ui_element import UIElementfrom marimo._plugins.ui._impl.tables.utils import get_table_managerfrom marimo._plugins.validators import validate_page_size+from marimo._utils.deprecated import deprecatedLOGGER = _loggers.marimo_logger()@@ -71,6 +72,16 @@ RowOrientedData = list[dict[str, Any]]ColumnOrientedData = dict[str, list[Any]]+@deprecated(+ "mo.ui.experimental_data_editor is deprecated. Use mo.ui.data_editor instead"+)+def experimental_data_editor(+ *args: Any,+ **kwargs: Any,+) -> data_editor:+ return data_editor(*args, **kwargs)++@mddocclass data_editor(UIElement[@@ -96,21 +107,21 @@ class data_editor(import pandas as pddf = pd.DataFrame({"A": [1, 2, 3], "B": ["a", "b", "c"]})- editor = mo.ui.experimental_data_editor(data=df, label="Edit Data")+ editor = mo.ui.data_editor(data=df, label="Edit Data")```Create a data editor from a list of dicts:```pythondata = [{"A": 1, "B": "a"}, {"A": 2, "B": "a"}, {"A": 3, "B": "c"}]- editor = mo.ui.experimental_data_editor(data=data, label="Edit Data")+ editor = mo.ui.data_editor(data=data, label="Edit Data")```Create a data editor from a dict of lists:```pythondata = {"A": [1, 2, 3], "B": ["a", "b", "c"]}- editor = mo.ui.experimental_data_editor(data=data, label="Edit Data")+ editor = mo.ui.data_editor(data=data, label="Edit Data")```Attributes:diff --git a/marimo/_smoke_tests/editable_df.py b/marimo/_smoke_tests/editable_df.pyindex 71f44155bf..05ab3ee5db 100644--- a/marimo/_smoke_tests/editable_df.py+++ b/marimo/_smoke_tests/editable_df.py@@ -57,7 +57,7 @@ def __(column_oriented, mo, pandas_df, polars_df, row_oriented):@app.celldef __(df, mo):- edited = mo.ui.experimental_data_editor(df.value)+ edited = mo.ui.data_editor(df.value)editedreturn (edited,)@@ -117,7 +117,7 @@ def __(pl, varying_data):@app.celldef __(mo, pl, varying_data):- edited_df = mo.ui.experimental_data_editor(pl.DataFrame(varying_data))+ edited_df = mo.ui.data_editor(pl.DataFrame(varying_data))edited_dfreturn (edited_df,)diff --git a/marimo/_smoke_tests/tables/rich_elements.py b/marimo/_smoke_tests/tables/rich_elements.pyindex e6182f4042..c8490fcd54 100644--- a/marimo/_smoke_tests/tables/rich_elements.py+++ b/marimo/_smoke_tests/tables/rich_elements.py@@ -208,7 +208,7 @@ def _(mo, pd, pl):@app.celldef _(data, mo):- mo.ui.experimental_data_editor(data=data, label="Edit Data")+ mo.ui.data_editor(data=data, label="Edit Data")returndiff --git a/tests/_plugins/ui/_impl/test_data_editor.py b/tests/_plugins/ui/_impl/test_data_editor.pyindex 0f11b8134a..3fe55e0a99 100644--- a/tests/_plugins/ui/_impl/test_data_editor.py+++ b/tests/_plugins/ui/_impl/test_data_editor.py@@ -14,7 +14,7 @@ from marimo._plugins.ui._impl.data_editor import (apply_edits,)-data_editor = ui.experimental_data_editor+data_editor = ui.data_editorHAS_PANDAS = DependencyManager.pandas.has()HAS_POLARS = DependencyManager.polars.has()diff --git a/tests/mocks.py b/tests/mocks.pyindex c9f00530e0..87e261162c 100644--- a/tests/mocks.py+++ b/tests/mocks.py@@ -76,7 +76,7 @@ def snapshotter(current_file: str) -> Callable[[str, str], None]:))- if text_diff:+ if text_diff != "":write_result()print("Snapshot updated")diff --git a/tests/snapshots/api.txt b/tests/snapshots/api.txtindex 3b32214754..ebf1e71795 100644--- a/tests/snapshots/api.txt+++ b/tests/snapshots/api.txt@@ -85,6 +85,7 @@ uichatcheckboxcode_editor+ data_editordata_explorerdataframedate