paddymul / buckaroo

Buckaroo - the data wrangling assistant for pandas. Quickly explore dataframes, and run pandas commands via a GUI. Works inside the jupyter notebook.
https://paddymul.github.io/buckaroo/
BSD 3-Clause "New" or "Revised" License
227 stars 9 forks source link

widget in vscode fails to render: JS error #331

Open mathematicalmichael opened 1 week ago

mathematicalmichael commented 1 week ago

Checks

What type of jupyter notebook were you using (VSCode notebook, google colab, Jupyter Lab, Jupyter notebook). Select multiple if you can reproduce this in multiple environments. If other, please add to description.

VS Code, Jupyter Lab

Reproducible example

show any dataframe:

import numpy as np
import pandas as pd
import buckaroo

num_df = pd.DataFrame(
    {'a':[111_111,  77_777, 777_777, 1_000_000, 2_111_111, 1_235_999],
     'b':[111_111, 555_555,       0,    28_123,   482_388,     5_666]})
num_df

I did this in a fresh https://lightning.ai studio with Python 3.11.10. After selecting that version and pip installing numpy, pandas, and buckaroo, you should be able to reproduce this as well. image

Issue description

cells don't render - neither in lab nor vscode. I believe this is because of the sources for widgets. Could you please clarify where the JS packages should come from?

image

environment: lightning.ai (remote EC2 instance)

image

settings.json: image

Expected behavior

missing js packages are downloaded automatically or a helpful message telling me what to do is shown.

Installed versions

image

``` Selected Jupyter core packages... executing in unknown buckaroo : 0.7.11 jupyterlab : not installed notebook : not installed ipywidgets : 8.1.5 traitlets : 5.14.3 jupyter_core : 5.7.2 pandas : 2.2.3 numpy : 2.1.3 IPython : 8.29.0 ipykernel : 6.29.5 jupyter_client : 8.6.3 jupyter_server : not installed nbclient : not installed nbconvert : not installed nbformat : not installed qtconsole : not installed buckaroo : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/buckaroo/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/buckaroo/__init__.py) jupyterlab : not installed notebook : not installed ipywidgets : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/ipywidgets/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/ipywidgets/__init__.py) traitlets : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/traitlets/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/traitlets/__init__.py) jupyter_core : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/jupyter_core/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/jupyter_core/__init__.py) pandas : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/pandas/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/pandas/__init__.py) numpy : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/numpy/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/numpy/__init__.py) IPython : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/IPython/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/IPython/__init__.py) ipykernel : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/ipykernel/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/ipykernel/__init__.py) jupyter_client : [/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/jupyter_client/__init__.py](https://vscode-remote+vscode-002d01j9d6myvzcvjh2eyeaf6vb4j2-002estudio-002elightning-002eai.vscode-resource.vscode-cdn.net/home/zeus/miniconda3/envs/cloudspace/lib/python3.11/site-packages/jupyter_client/__init__.py) jupyter_server : not installed nbclient : not installed nbconvert : not installed nbformat : not installed qtconsole : not installed```

Jupyter Log output

No response

paddymul commented 1 week ago

Thank you for the bug report. I'm digging in.

Incidentally I recently asked a Microsoft rep for help with setting up CI against buckaroo and VSCode.

paddymul commented 1 week ago

Heads up. I will try to get a fix together this week. I hope that works with your timeline

paddymul commented 5 days ago

AnyWidget solves this problem.

I'm making progress on this. I have a version based on anywidget that works, I'd like to use ipyreact, and I have one stumbling block there.

Anywidget injects your entire js module into the dom for each invocation of the widget. IPYReact (built on top of anywidget) has a fix for this.

How are you at JS Build chains (vite, webpack, css)? Want to pair on a couple bits of this problem.

mathematicalmichael commented 5 days ago

unfortunately I am pretty clumsy with JS tooling in general. I know enough to get by with an LLM but have not invested time to learn properly. I have built my fair share of docker images to get web projects working but can't say I'm confident in those particular skills.

mathematicalmichael commented 5 days ago

there's no rush on my end. i just thought your tool looked particularly cool and thought I'd assess whether to add it to my toolbox yet. ill keep an eye on my github notifs. thanks for being so responsive!