Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions marimo/_ast/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def _pytest_scaffold(stub: Any) -> Any:
def build_stub_fn(
func_body: ast.FunctionDef | ast.AsyncFunctionDef,
file: str = "",
basis: None | Callable[..., Any] = None,
allowed: None | list[str] = None,
basis: Callable[..., Any] | None = None,
allowed: list[str] | None = None,
) -> Callable[..., Any]:
# Avoid declaring the function in the global scope, since it may cause
# issues with meta-analysis tools like cxfreeze (see #3828).
Expand Down
2 changes: 1 addition & 1 deletion marimo/_lint/diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Diagnostic:
message: str
line: int | list[int]
column: int | list[int]
cell_id: None | list[CellId_t] = None
cell_id: list[CellId_t] | None = None
code: str | None = None
name: str | None = None
severity: Severity | None = None
Expand Down
2 changes: 1 addition & 1 deletion marimo/_messaging/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CellNotification(Notification, tag="cell-op"):
# Tri-state partial update: UNSET (omitted on the wire) leaves the cell's
# serialization hint unchanged; None explicitly clears it (cell is no
# longer a top-level definition); a string sets it.
serialization: str | None | msgspec.UnsetType = msgspec.UNSET
serialization: str | msgspec.UnsetType | None = msgspec.UNSET
timestamp: float = msgspec.field(default_factory=lambda: time.time())

def __post_init__(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion marimo/_output/formatters/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _escape_fallback(s: str) -> str:

def _leaf_formatter(
value: object,
) -> bool | None | str | int:
) -> bool | str | int | None:
formatter = formatting.get_formatter(value)

# Because we don't flatten subclasses of structures, we need to avoid
Expand Down
2 changes: 1 addition & 1 deletion marimo/_runtime/dataflow/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def get_transitive_references(
return processed | refs
return processed - refs

def copy(self, filename: None | str = None) -> DirectedGraph:
def copy(self, filename: str | None = None) -> DirectedGraph:
"""Return a deep copy of the graph by recompiling all cells.

This is mainly useful in the case where recompilation must be done
Expand Down
2 changes: 1 addition & 1 deletion marimo/_runtime/packages/import_error_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def extract_missing_module_from_cause_chain(
This handles cases where a `ModuleNotFoundError` was raised and then wrapped,
e.g., via `raise ImportError("helpful message") from err`
"""
current: None | BaseException = error
current: BaseException | None = error
while current is not None:
if (
isinstance(current, ModuleNotFoundError)
Expand Down
6 changes: 3 additions & 3 deletions marimo/_save/loaders/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ def __init__(
self,
name: str,
store: Store | None = None,
signer: CacheSigner | None | _Unset = _SIGNER_UNSET,
trusted_signers: Iterable[str] | None | _Unset = _TRUSTED_UNSET,
signer: CacheSigner | _Unset | None = _SIGNER_UNSET,
trusted_signers: Iterable[str] | _Unset | None = _TRUSTED_UNSET,
verification: str | _Unset = _VERIFICATION_UNSET,
) -> None:
"""Create a LazyLoader.
Expand Down Expand Up @@ -847,7 +847,7 @@ def signer(self) -> CacheSigner | None:
return self._signer

@signer.setter
def signer(self, value: CacheSigner | None | _Unset) -> None:
def signer(self, value: CacheSigner | _Unset | None) -> None:
# Validate up front (mirrors __init__) so a bad reconfigure fails here
# rather than as an AttributeError mid-save.
if not isinstance(value, (_Unset, CacheSigner)) and value is not None:
Expand Down
2 changes: 1 addition & 1 deletion marimo/_schemas/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ExportAsHTMLRequest(msgspec.Struct, rename="camel"):
files: list[str]
include_code: bool
asset_url: str | None = None
layout: LayoutConfig | None | msgspec.UnsetType = msgspec.UNSET
layout: LayoutConfig | msgspec.UnsetType | None = msgspec.UNSET


def to_html_export_options(
Expand Down
2 changes: 1 addition & 1 deletion marimo/_server/ai/mcp/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
| int
| float
| bool
| None
| list["MCPToolValue"]
| dict[str, "MCPToolValue"]
| None
)
MCPToolArgs: TypeAlias = dict[str, MCPToolValue] | None
2 changes: 1 addition & 1 deletion marimo/_utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def is_env_true(key: str, default: bool = False) -> bool:
return value.strip().lower() in ("true", "1")


def env_to_value(key: str) -> tuple[str | None | list[str] | bool] | None:
def env_to_value(key: str) -> tuple[str | list[str] | bool | None] | None:
"""Return a typed value from environment variables."""
if key in os.environ:
value = os.environ[key]
Expand Down
2 changes: 1 addition & 1 deletion marimo/_utils/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def first(iterable: Iterable[T] | T) -> T:
return iterable


def as_list(value: T | None | list[T]) -> list[T]:
def as_list(value: T | list[T] | None) -> list[T]:
if value is None:
return []
return value if isinstance(value, list) else [value] # type: ignore[no-any-return]
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ ignore = [
"FURB189", # Subclassing built-in collections
"FURB152", # Replace literal with a math constant
"FURB110", # Replace ternary with an `or` expression
"RUF036", # `None` is not last in a union
"FURB113", # Repeated `append` calls
"NPY002", # Legacy NumPy random API
"RUF100", # Unused `noqa` directive
Expand Down
Loading