marimo icon indicating copy to clipboard operation
marimo copied to clipboard

duckdb doesn't support DataFrames with numpy arrays in them

Open yairchu opened this issue 1 month ago • 3 comments

Describe the bug

If a DataFrame has numpy arrays in it, SQL cells fail importing it as a table with Unimplemented type for cast (DOUBLE[] -> DOUBLE)

Will you submit a PR?

  • [ ] Yes

Environment

{
  "marimo": "0.17.0",
  "editable": true,
  "location": "/Users/yairchu/dev/marimo/marimo",
  "OS": "Darwin",
  "OS Version": "24.6.0",
  "Processor": "arm",
  "Python Version": "3.12.9",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "140.0.7339.134",
    "Node": "v22.13.0"
  },
  "Dependencies": {
    "click": "8.3.0",
    "docutils": "0.22.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.9",
    "narwhals": "2.7.0",
    "packaging": "25.0",
    "psutil": "7.1.0",
    "pygments": "2.19.2",
    "pymdown-extensions": "10.16.1",
    "pyyaml": "6.0.3",
    "starlette": "0.48.0",
    "tomlkit": "0.13.3",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.35.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "altair": "5.5.0",
    "duckdb": "1.4.1",
    "openai": "2.3.0",
    "pandas": "2.3.3",
    "pyarrow": "21.0.0",
    "loro": "1.8.1",
    "sqlglot": "27.26.0"
  },
  "Experimental Flags": {
    "performant_table_charts": true,
    "multi_column": true,
    "cache_panel": true,
    "chat_modes": true
  }
}

Code to reproduce

Any SQL query from this DataFrame fails.

example_df = pd.DataFrame(
    [
        [np.random.random(size=[2, 2]) for _col in range(2)]
        for _row in range(3)
    ],
    columns=["A", "B"],
)
example_df

Example query: SELECT COUNT(*) FROM example_df

yairchu avatar Oct 23 '25 11:10 yairchu