altair icon indicating copy to clipboard operation
altair copied to clipboard

Local data server breaks with transition to altair 5.0.0

Open caleb-lindgren opened this issue 2 years ago • 2 comments

In order to handle some large datasets, I've been using the local data server option described here in the latest documentation. However, when I run this code with altair 5.0.0, I get a NoSuchEntryPoint exception:

Python 3.10.11 (main, May  9 2023, 12:49:29) [GCC 13.1.1 20230429] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import altair as alt
>>> alt.data_transformers.enable('data_server')
Traceback (most recent call last):
  File "/home/caleb/.pyenv/versions/3.10.11/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 155, in _enable
    (ep,) = [
ValueError: not enough values to unpack (expected 1, got 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/caleb/.pyenv/versions/3.10.11/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 194, in enable
    return PluginEnabler(self, name, **options)
  File "/home/caleb/.pyenv/versions/3.10.11/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 41, in __init__
    self.registry._enable(name, **options)
  File "/home/caleb/.pyenv/versions/3.10.11/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 164, in _enable
    raise NoSuchEntryPoint(self.entry_point_group, name) from err
altair.utils.plugin_registry.NoSuchEntryPoint: No 'data_server' entry point found in group 'altair.vegalite.v5.data_transformer'
>>>

If I downgrade to altair version 4.2.2 the same code works with no issues.

I have the latest version of altair-data-server (0.4.1).

I get the same results when running this from jupyter-lab, I just figured demonstrating it in the command line would be a simpler example.

caleb-lindgren avatar May 09 '23 19:05 caleb-lindgren

Thank you for the report. altair_data_server is indeed not yet supported by Altair version 5. The best thing for now is that we can add a note to the documentation that altair_data_server does not yet support Altair 5.

If you are using large datasets including aggregations in your Altair specification than the recent developments of VegaFusion might be of interest to you as well, see https://altair-viz.github.io/user_guide/large_datasets.html#vegafusion and https://vegafusion.io/ for more info on this.

Again, thanks for the report!

mattijn avatar May 09 '23 20:05 mattijn

Based on https://github.com/hex-inc/vegafusion/issues/309, it seems like the VegaFusion widget renderer covers most use cases that the data-server was used for. It still makes sense to update the data-server to support v5 for compatibility reasons, but maybe we should clearly mark it as being in maintenance mode and direct people to use the VegaFusion widget renderer more explicitly in the docs?

joelostblom avatar May 11 '23 22:05 joelostblom