marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.39k stars 158 forks source link

Error on display of polars dataframe with array element type #1706

Closed ggggggggg closed 5 days ago

ggggggggg commented 5 days ago

Describe the bug

I defined a polars dataframe with one column having an array datatype, and get an error.

Environment

{ "marimo": "0.6.25", "OS": "Windows", "OS Version": "10", "Processor": "Intel64 Family 6 Model 85 Stepping 4, GenuineIntel", "Python Version": "3.10.11", "Binaries": { "Browser": "126.0.6478.127", "Node": "--" }, "Requirements": { "click": "8.1.7", "importlib-resources": "missing", "jedi": "0.19.0", "markdown": "3.6", "pymdown-extensions": "10.8.1", "pygments": "2.16.1", "tomlkit": "0.12.5", "uvicorn": "0.30.1", "starlette": "0.37.2", "websockets": "12.0", "typing-extensions": "4.7.1", "black": "23.7.0" } }

Code to reproduce

import marimo as mo
import polars as pl

pl.DataFrame({"a":[np.zeros(5) for i in range(5)]}, schema={"a":pl.Array(pl.Float64,5)})

Above results in an error.

mo.plain(pl.DataFrame({"a":[np.zeros(5) for i in range(5)]}, schema={"a":pl.Array(pl.Float64,5))

Displays ok.