diff --git a/marimo/_plugins/ui/_impl/dataframes/handlers.py b/marimo/_plugins/ui/_impl/dataframes/handlers.py index 58f9852d07..4181276831 100644 --- a/marimo/_plugins/ui/_impl/dataframes/handlers.py +++ b/marimo/_plugins/ui/_impl/dataframes/handlers.py @@ -178,7 +178,11 @@ def handle_aggregate( column_id: transform.aggregations for column_id in transform.column_ids } - return df.agg(dict_of_aggs) # type: ignore[arg-type] + + # Pandas type-checking doesn't like the fact that the values + # are lists of strings (function names), even though the docs permit + # such a value + return cast("pd.DataFrame", df.agg(dict_of_aggs)) # type: ignore[arg-type] @staticmethod def handle_select_columns(