Traceback (most recent call last):
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 157, in execute_cell
exec(cell.body, glbls)
Cell marimo:///home/marcogorelli/scratch/untitled.py#cell=cell-0
, line 28, in <module>
fig = px.sunburst(data, path=path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/plotly/express/_chart_types.py", line 1688, in sunburst
return make_figure(
^^^^^^^^^^^^
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/plotly/express/_core.py", line 2117, in make_figure
args = build_dataframe(args, constructor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/plotly/express/_core.py", line 1455, in build_dataframe
necessary_columns.update(i for i in args[field] if i in columns)
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/plotly/express/_core.py", line 1455, in <genexpr>
necessary_columns.update(i for i in args[field] if i in columns)
^^^^^^^^^^^^
File "/home/marcogorelli/scratch/.venv/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 5175, in __contains__
hash(key)
TypeError: unhashable type: 'Series'
On the other hand, it works if:
I use path = ['total', "regions", "sectors", "vendors"]
if the input is a dataframe for which Narwhals has full api support, then it's probably not necessary to do the column selection pushdown
for interchange-only inputs (e.g. DuckDB), then they have no notion of free-standing Series anyway, and so determining the columns to do projection pushdown with should be safe
This raises:
On the other hand, it works if:
path = ['total', "regions", "sectors", "vendors"]
The error is this part:
https://github.com/plotly/plotly.py/blob/72bacb569b5e571f3af9ada082e80dd948321d75/packages/python/plotly/plotly/express/_core.py#L1448-L1459