vegafusion: Expected Table-like input error when creating an altair chart

Altair 5.5.0 VegaFusion 2.0.1

I’m trying to create charts using the vegafusion transformer, but I get the following error: TypeError: Expected Table-like input or dict of arrays or sequence of arrays.

This code generates the error: import pandas as pd import altair as alt chart_data = pd.DataFrame([1,2,3,4,5],columns=['y']) alt.Chart(chart_data).mark_bar().encode(y='y')

I have a different computer with the same versions of Python, Altair and VegaFusion where this code works.

So far, I have tried to uninstall and reinstall Altair, VegaFusion and Python without success.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 32 (15 by maintainers)

Most upvoted comments

Well, I use a virtual environment. so the version is the latest compatible with all the requirements. I use uv to manage my dependencies. I did uv add pandas altair vega[embed] vegafusion vegafusion-python-embed vl-convert-python But for reference, here is my dependency tree: https://gist.github.com/rambip/71fa35fdf2e1f218c3aa9e28aaee0627

Turns out I don’t have pyarrow installed

this is the output

|Narwhals DataFrame|
|------------------|
|          y       |
|       0  1       |
|       1  2       |
|       2  3       |
|       3  4       |
|       4  5       |
└──────────────────┘
arro3.core.Table
-----------

ah thanks - this’ll be fixed by https://github.com/vega/vegafusion/pull/560