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
Utility class for fn that take 0 args (#233)
Akshay Agrawal4e22a2cffafd
diff --git a/marimo/_runtime/functions.py b/marimo/_runtime/functions.pyindex 3c53ae37a8..752e8f2d7d 100644--- a/marimo/_runtime/functions.py+++ b/marimo/_runtime/functions.py@@ -13,6 +13,12 @@ S = TypeVar("S")T = TypeVar("T")+class EmptyArgs:+ """Utility type for functions that take no arguments."""+ ...++@dataclasses.dataclassclass Function(Generic[S, T]):name: strdiff --git a/marimo/_utils/test_parse_dataclass.py b/marimo/_utils/test_parse_dataclass.pyindex 59b9653cd3..469854e584 100644--- a/marimo/_utils/test_parse_dataclass.py+++ b/marimo/_utils/test_parse_dataclass.py@@ -7,7 +7,7 @@ from typing import Any, Dict, List, Tuplefrom marimo._server import apifrom marimo._server.api.set_cell_config import SetCellConfig-from marimo._utils.parse_dataclass import parse_raw+from marimo._utils.parse_dataclass import build_dataclass, parse_raw@dataclass@@ -124,5 +124,13 @@ class TestParseRaw:parsed = parse_raw(serialize(config), api.set_cell_config.SetCellConfig)- print(parsed)assert parsed == config+++def test_build_empty_dataclass() -> None:+ @dataclass+ class Empty:+ ...++ parsed = build_dataclass({}, Empty)+ assert parsed == Empty()