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

Running download_data.py throws a ValueError: Couldn't cast options: list<item: string> #8

Open
Xuanaaa opened this issue Oct 11, 2024 · 0 comments

Comments

@Xuanaaa
Copy link

Xuanaaa commented Oct 11, 2024

Traceback (most recent call last):
File "D:\CVTECode\qatools.venv\lib\site-packages\datasets\builder.py", line 1894, in _prepare_split_single
writer.write_table(table)
File "D:\CVTECode\qatools.venv\lib\site-packages\datasets\arrow_writer.py", line 570, in write_table
pa_table = table_cast(pa_table, self._schema)
File "D:\CVTECode\qatools.venv\lib\site-packages\datasets\table.py", line 2324, in table_cast
return cast_table_to_schema(table, schema)
File "D:\CVTECode\qatools.venv\lib\site-packages\datasets\table.py", line 2282, in cast_table_to_schema
raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match")
ValueError: Couldn't cast
options: list<item: string>
child 0, item: string
question: string
id: int64
category: string
to
{'Offensiveness': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Unfairness and Bias': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Physical Health': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Mental Health': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Illegal Activities': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Ethics and Morality': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}], 'Privacy and Property': [{'question': Value(dtype='string', id=None), 'options': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'answer': Value(dtype='int64', id=None)}]}
because column names don't match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant