Dataset Viewer issue: UnexpectedError

#1
by pod9199 - opened

The dataset viewer is not working.

Error details:

CastError: Couldn't cast
topic: string
reference2: string
reference1: string
votes: int64
to
{'topic': Value(dtype='string', id=None), 'score': Value(dtype='int64', id=None), 'reference2': Value(dtype='string', id=None), 'reference1': Value(dtype='string', id=None)}
because column names don't match
During handling of the above exception, another exception occurred:

DatasetGenerationCastError                Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id)
   1989                         writer.write_table(table)
   1990                     except CastError as cast_error:
-> 1991                         raise DatasetGenerationCastError.from_cast_error(
   1992                             cast_error=cast_error,
   1993                             builder_name=self.info.builder_name,

DatasetGenerationCastError: An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 1 new columns (votes) and 1 missing columns (score).

This happened while the json dataset builder was generating data using

hf://datasets/JWBickel/bible_topics/topic_votes.json (at revision 4878cbc04e3c36f561b43da2a5c709f8378f4af8)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Error code:   UnexpectedError

cc @albertvillanova @lhoestq @severo .

Thanks for bringing it up. When I first published this, I didn't know how to make multiple configurations so that wouldn't happen. It's fixed now.

JWBickel changed discussion status to closed

Sign up or log in to comment