datasets icon indicating copy to clipboard operation
datasets copied to clipboard

Allow pathlib PoxisPath in Dataset.read_json

Open cccntu opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

from pathlib import Path
from datasets import Dataset
ds = Dataset.read_json(Path('data.json'))

causes an error

AttributeError: 'PosixPath' object has no attribute 'decode'

Describe the solution you'd like

It should be able to accept PosixPath and read the json from inside.

cccntu avatar Aug 19 '22 12:08 cccntu