Dataset Viewer issue

#1
by wahid028 - opened

The dataset viewer is not working.

Error details:

Error code:   RowsPostProcessingError

cc @albertvillanova @lhoestq @severo .

wahid028 changed discussion status to closed

The full error is:

{
  "error": "An error occurred while generating the dataset",
  "cause_exception": "DatasetGenerationError",
  "cause_message": "An error occurred while generating the dataset",
  "cause_traceback": [
    "Traceback (most recent call last):\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 1989, in _prepare_split_single\n writer.write_table(table)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py\", line 574, in write_table\n pa_table = table_cast(pa_table, self._schema)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 2322, in table_cast\n return cast_table_to_schema(table, schema)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 2281, in cast_table_to_schema\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 2281, in <listcomp>\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 1797, in wrapper\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 1797, in <listcomp>\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 2062, in cast_array_to_feature\n casted_values = _c(array.values, feature.feature)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 1799, in wrapper\n return func(array, *args, **kwargs)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 2110, in cast_array_to_feature\n return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 1799, in wrapper\n return func(array, *args, **kwargs)\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py\", line 1994, in array_cast\n raise TypeError(f\"Couldn't cast array of type\\n{array.type}\\nto\\n{pa_type}\")\n",
    "TypeError: Couldn't cast array of type\nstruct<id: string, start: int64, end: int64>\nto\nnull\n",
    "\nThe above exception was the direct cause of the following exception:\n\n",
    "Traceback (most recent call last):\n",
    " File \"/src/services/worker/src/worker/job_manager.py\", line 158, in process\n job_result = self.job_runner.compute()\n",
    " File \"/src/services/worker/src/worker/job_runners/config/parquet_and_info.py\", line 1288, in compute\n compute_config_parquet_and_info_response(\n",
    " File \"/src/services/worker/src/worker/job_runners/config/parquet_and_info.py\", line 1198, in compute_config_parquet_and_info_response\n parquet_operations, partial = stream_convert_to_parquet(\n",
    " File \"/src/services/worker/src/worker/job_runners/config/parquet_and_info.py\", line 802, in stream_convert_to_parquet\n builder._prepare_split(\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 1860, in _prepare_split\n for job_id, done, content in self._prepare_split_single(\n",
    " File \"/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py\", line 2016, in _prepare_split_single\n raise DatasetGenerationError(\"An error occurred while generating the dataset\") from e\n",
    "datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset\n"
  ]
}

ie:

Couldn't cast array of type
  struct<id: string, start: int64, end: int64>
to
  null

Maybe @lhoestq @mariosasko @albertvillanova @polinaeterna can give more details

It's a bug on our side that has been fixed with https://github.com/huggingface/datasets/pull/6743 in the datasets lib

The fix should be available for the Viewer soon, once there is a new datasets release

Sign up or log in to comment