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

Online validator: "Click to select" doesn't work #9

Open
lindemann09 opened this issue Oct 1, 2019 · 1 comment
Open

Online validator: "Click to select" doesn't work #9

lindemann09 opened this issue Oct 1, 2019 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@lindemann09
Copy link

If using "Click to select" to select the data folder, the validator doesn't find a JSON file. "Drag and drop" works correctly.

@FelixHenninger FelixHenninger added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Oct 1, 2019
@FelixHenninger
Copy link
Collaborator

Hej Oliver, thanks a lot! We've run into this multiple times now, and have discussed it over in issue #2 as well. I'm going to make this the main thread for this particular issue and go into a bit more detail.

The underlying problem is that the validation input expects to get the following format from the browser:

{
    "dataset_description.json": File(...),
    "data/foo.csv": File(...),
    /* ... */
}

This works well per drag-and-drop, the difficulty when clicking to select a directory is that the browser includes the directory name in all file paths, so dataset_description.json becomes my_random_directory/dataset_description.json.

Here's what I think would be good steps toward a solution:

  • First, as a stop-gap, de-activate or de-emphasize click-to-select. I just did that in 2eca8d4
  • Second, the obvious solution is to remove the common my_random_directory/prefix from all paths, so that there is at least one file at the top level. That isn't hard technically, what's stopping me from implementing it is that I'm not 100% sure if this idea doesn't have negative side effects. Specifically, what if someone validates a data folder that only contains data, but doesn't have a dataset_description.json in it, will truncating a common prefix assume that the data files are at the top level of the folder structure? Thus, should we truncate everything that isn't called data/? I'm not sure, and I think this needs a bit more thinking through to cover the edge cases.

Ok, that's what I have for now. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants