Error accessing the dataset

#1
by akskuchi - opened

Hello,

Thanks for your work!

When I try to access this dataset through hugging-face datasets library, I encountered the following error:

pyarrow.lib.ArrowInvalid: JSON parse error: Column(/players_data/home_substituted_players/[]/players_rating) changed from number to string in row 0

Could you please check if the formats of the uploaded dataset are as expected.

Kind regards.

Hi! Sorry for late reply since I was busy last few days. I saw you have passed the request so you should have the permission to this dataset. The error occurs because the players_rating field in your JSON data has mixed types (some rows are numbers, others are strings). PyArrow requires consistent data types.

Quick Fixes:
Preprocess the JSON to ensure all players_rating values are the same type (e.g., convert strings to numbers).

Explicitly define a schema when loading the data, forcing players_rating to a specific type (e.g., float).

I'm not sure if this would help, but welcome to message me for any further problems! Good luck.

Hello,

Thanks for the suggestions, but just to clarify, I get this error when I try to access the data using HuggingFace's datasets library (after pip install datasets)—I don't use PyArrow directly.
Code:

from datasets import load_dataset
train_dataset = load_dataset("Homie0609/SoccerReplay-1988", split="train")

Error:

Generating train split: 0 examples [00:00, ? examples/s]
Failed to load JSON from file 'huggingface/hub/datasets--Homie0609--SoccerReplay-1988/snapshots/a9c4a6b84279ee8eb427127a4ff08b140392fd37/train/england_epl_2017-2018/2017-08-13_manchester-united-west-ham-united-premier-league-2017-2018/2017-08-13_Manchester_Utd_4-0_West_Ham_lpoWCpyH.json' with error <class 'pyarrow.lib.ArrowInvalid'>: JSON parse error: Column(/players_data/home_substituted_players/[]/players_rating) changed from number to string in row 0

So, for now, I'm accessing the data by cloning the repository: git clone [email protected]:datasets/Homie0609/SoccerReplay-1988
But to make it accessible through the datasets library, you would need to find the error and correct the schema of the .jsonl files here.

Kind regards.

Sign up or log in to comment