Skip to content
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

Cannot open a CSV from "Open with ..." menu #68

Open
suvayu opened this issue Apr 26, 2019 · 4 comments
Open

Cannot open a CSV from "Open with ..." menu #68

suvayu opened this issue Apr 26, 2019 · 4 comments

Comments

@suvayu
Copy link

suvayu commented Apr 26, 2019

When I open a CSV from the "Open with ..." menu, I get the error String(...).match(...) is null in a popup from Firefox, with a "OK" button. Clicking the button opens voyager, but none of the CSV columns are detected, and I can't visualise anything.
jupyterlab-voyager-bug

@playermanny2
Copy link
Collaborator

@suvayu

Can you post more information about your issue, as there's some known potential issues with some .csv files, but most of the .csvs i have been trying do open properly

Firstly, can you try to open up the data.csv in test/data included within this repository

1.Steps to reproduce(including the dateset you're trying)
2.Any relevant logs from jupyterlab
3.Any relevant logs from JavaScript console

@suvayu
Copy link
Author

suvayu commented May 8, 2019

@playermanny2 I digged a bit deeper, it turns out this error happens when there is an empty column name in the csv. In my case I had exported the csv from pandas with DataFrame.to_csv(..). By default (if you specify only the file name and nothing else, then header=True, index=True, index_label=None), the column name for index is empty. When I manually edit and add the index column name, the csv opens without issues.

Since this is rather common, maybe Voyager should assume a place holder like: column_n, if the column name is empty?

@playermanny2
Copy link
Collaborator

@suvayu

Thanks for digging into this deeper --will have to take a look at this a bit deeper to see if this is a problem with voyager itself not being able to handle empty column names or our extension.

The fallback seems like it could be a viable route

@playermanny2
Copy link
Collaborator

@suvayu per a quick test on http://vega.github.io/voyager/

This is the behavior directly from Voyager. I'm not sure if they chose not to create fallbacks for a valid reason -- usually it's best practice to not manipulate data received in anyway.

@saulshanabrook what do you think about adding in a fallback for handling empty columns in data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants