Skip to content

Commit

Permalink
fix pandas typecheck (#808)
Browse files Browse the repository at this point in the history
* fix pandas typecheck

* fix
  • Loading branch information
akshayka committed Feb 20, 2024
1 parent f0d021a commit b3f1096
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion marimo/_plugins/ui/_impl/dataframes/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b3f1096

Please sign in to comment.