Column order is nondeterministic when loading from JSON
albertvillanova opened this issue · comments
Albert Villanova del Moral commented
As reported by @meg-huggingface, the order of the JSON object keys is not preserved while loading a dataset from a JSON file with a list of objects.
For example, when loading a JSON files with a list of objects, each with the following ordered keys:
- [ID, Language, Topic],
the resulting dataset may have columns:
- [ID, Topic, Language], or
- [Topic, Language, ID], or
- [Topic, ID, Language],...
This issue is caused by the use of a Python set (which does not preserve the order):
introduced in