-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatability with the data server transformer #31
Comments
Thanks for the report @joelostblom. vl-convert doesn't assume anything about using VegaFusion, and it should be able to load data from the URL served by the data server transformer so I'm not sure yet what's going on. |
Ok, I spent some time looking at this. It looks like a deadlock is being created between the tornado event loop that the Altair data server uses to serve files in the background, and the async runtime event loop that Deno is running on. I tried a couple of things, but this might not be an issue we can solve in the near term. So on the Altair side, maybe we should consider swapping the default back to altair_saver for v5. We could also probably detect that altair data server is active and raise an informative error message if the vl-convert logic path is invoked in this situation. |
Actually, I think we could just disable data transformers all together when calling |
Hmmm, I very much want to keep vl-convert the default for the next Altair version. When I use altair_saver in class there are always issues for students, and this year I couldn't work around them so I made a function that wrapped vl-convert and they could use, which has been seamless for most of them! I discovered that the data transformers can be used as context managers, so what do you think of just wrapping the calls to vl-convert in the Altair code base like this: with alt.data_transformers.enable('default') and alt.data_transformers.disable_max_rows():
png_data = vlc.vegalite_to_png(chart.to_dict())
with open("chart.png", "wb") as f:
f.write(png_data) Do you foresee any issues with that? |
Great to hear vl-convert worked well for your students! Yeah, this is exactly what I was thinking. Using the default data transformer as a context manager looks like a great approach. Feel free to go ahead and add that to Altair if it's easy for you, but I can take care of it next week otherwise. |
I noticed that enabling the data server transformer causes vl convert to hang indefinitely. Is this something that is fixable or is vl-convert meant to be used with vega-fusion instead? Since we are planning to have vl-convert take precedence over altair_saver, it would be great if it also worked with the data server transformer like altair_saver does to ensure full backwards compatibility.
Example that hangs for me on vl-convert 0.5.0 and altair 4.2.0, python 3.10.x
The text was updated successfully, but these errors were encountered: