Skip to content

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.

fix: use Union instead of pipe operator for tables (#4981)

Shahmir Varqha8ca6941d413e
diff --git a/marimo/_plugins/ui/_impl/table.py b/marimo/_plugins/ui/_impl/table.py
index d4e975b4bd..2df3ba01b1 100644
--- a/marimo/_plugins/ui/_impl/table.py
+++ b/marimo/_plugins/ui/_impl/table.py
@@ -111,7 +111,7 @@ class SearchTableArgs:
sort: Optional[SortArgs] = None
filters: Optional[list[Condition]] = None
limit: Optional[int] = None
- max_columns: Optional[int | MaxColumnsNotProvided] = (
+ max_columns: Optional[Union[int, MaxColumnsNotProvided]] = (
MAX_COLUMNS_NOT_PROVIDED
)
@@ -934,7 +934,7 @@ class table(
columns = self._searched_manager.get_column_names()
response = self._get_row_ids(EmptyArgs())
- row_ids: list[int] | range
+ row_ids: Union[list[int], range]
if response.all_rows is True or response.error is not None:
# TODO: Handle sorted rows, they have reverse order of row_ids
row_ids = range(skip, skip + take)