Dataset Viewer issue: FeaturesError
#1
by
pyrihtm
- opened
Hi! The dataset viewer is not working. It looks like the problem is with the last row. However, json is valid and i'm not sure what causes the error.
Error details:
Error code: FeaturesError
Exception: ValueError
Message: Not able to read records in the JSON file at hf://datasets/pyrihtm/product_100@4b8f1977f841f76ed5a24270c28ee80a01a85185/product_100.json.
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 241, in compute_first_rows_from_streaming_response
iterable_dataset = iterable_dataset._resolve_features()
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2216, in _resolve_features
features = _infer_features_from_batch(self.with_format(None)._head())
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1239, in _head
return _examples_to_batch(list(self.take(n)))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1389, in __iter__
for key, example in ex_iterable:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1044, in __iter__
yield from islice(self.ex_iterable, self.n)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 282, in __iter__
for key, pa_table in self.generate_tables_fn(**self.kwargs):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 165, in _generate_tables
raise ValueError(f"Not able to read records in the JSON file at {file}.") from None
ValueError: Not able to read records in the JSON file at hf://datasets/pyrihtm/product_100@4b8f1977f841f76ed5a24270c28ee80a01a85185/product_100.json.
I just noticed it's because I use a list of json objects for one of the columns ("output"). It expects each element to follow the same structure as the first uploaded example. So here my last data row had image: "" structure, although before it has always been image: [{}]
pyrihtm
changed discussion status to
closed