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
data_transformers not working in Jupyterlab #1651
Comments
Hello, I can acknowledge this issue too. I am using
Any chart created with the json data transformer (for instance example given below) import altair as alt
alt.data_transformers.enable('json')
from vega_datasets import data
iris = data.iris()
alt.Chart(iris).mark_point().encode(
x='petalLength',
y='petalWidth',
color='species'
) results with empty chart and Jupyter Lab outputs
in the console. |
Thanks for the report. I'm not certain we can support this change of behavior in the jupyterlab frontend. I'd suggest raising an issue with Jupyterlab, and in the meantime no using the json transformer. |
The change in jlab came from jupyterlab/jupyterlab#6985 How is altair using the manager.services.contents.getDownloadUrl function? Is it trying to manually append a path after it (it shouldn't if it is). |
Altair doesn't use any jupyterlab-specific functionality: my understanding is that the Jupyter ecosystem is designed such that the backend must be agnostic to the frontend, so as JupyterLab's frontend diverges from Jupyter Notebook's frontend, packages that require nontrivial frontend-side logic will have to choose which to support and which to drop. |
I think the best option to fix this from the altair side would be to create a |
Actually it looks like the problem is in the Vega plugin for jlab. I posted some comments on the JLab issue. |
Which jupyterlab issue? I don't see any additional comments at the link above. |
It was an automatic reference above |
OK, great. I'm not familiar with the JupyterLab vega extension – is it a straightforward fix? |
On the Altair side, the JSON extension is placing a file in the current directory and assuming it is accessible from the frontend as a relative url ( |
Thanks for the explanation. That should work for most cases. |
It should be. Basically it was asking for a download URL for the current path, and assuming that it could treat that like a base path, so it wasn't stripping off query parameters, etc. It should strip off the query parameters before assuming it can use it as a base url. |
Okay, this should be fixed in jupyterlab/jupyterlab#7022. |
There is an issue with using the data transformers in the latest version of Juptyerlab (1.0.5) resulting in the error
403 GET /files/?_xsrf=2|572196ba|42fbfea4f325901e3948cbc75bd747c8|1565583318/altair-data-6572fe4ca88650e09d67c52dd6a94b8a.json (172.17.0.1): is not a file
The problem seems to be in the GET request, which has the
_xsrf
information before the file information. Using the dev tools to edit and resend the request either the removal of the_xsrf
parameter from the url, or moving it after the filename results in a successful request.I realise this is probably not an issue with altair, however I don't know which would be the most suitable repository.
The code to reproduce is below, which can be run in a new environment (I have also tried docker container) using
The text was updated successfully, but these errors were encountered: