Ignore missing JSON files with `FileNotFoundError` except

#7
by parkervg - opened

KeyError -> FileNotFoundError in Handling Missing Files

In loading the dataset, the following error was raised:

FileNotFoundError: [Errno 2] No such file or directory: '~/.cache/huggingface/datasets/downloads/extracted/807f2a9200aa3db507d051a944437b7c8c5eb0de21039735c683affca111c338/WikiTables-WithLinks/tables_tok/The_Real_World:_Brooklyn_0.json'

As this error is due to the file The_Real_World:_Brooklyn_0.json missing from the repo, it should be caught in the comment made on line 147 ("...filenames with ':'").

However, the except clause needs to catch FileNotFoundError instead of KeyError.

Long-term, would be great to have the missing files handled in this dataset! But short-term, it seems like this PR will fix things (:

Also - looks like even with this change, we get a NonMatchingSplitsSizesError with datasets==2.12.0.

Thanks for the investigation and the fix.

We are fixing the NonMatchingSplitsSizesError...

albertvillanova changed pull request status to merged

Done. See #8 and #9.

Sign up or log in to comment