daft.read_json#

daft.read_json(path: Union[str, List[str]], schema_hints: Optional[Dict[str, daft.datatype.DataType]] = None, fs: Optional[fsspec.spec.AbstractFileSystem] = None) daft.dataframe.dataframe.DataFrame[source]#

Creates a DataFrame from line-delimited JSON file(s)

Example

>>> df = daft.read_json("/path/to/file.json")
>>> df = daft.read_json("/path/to/directory")
>>> df = daft.read_json("/path/to/files-*.json")
>>> df = daft.read_json("s3://path/to/files-*.json")
Parameters
  • path (str) – Path to JSON files (allows for wildcards)

  • schema_hints (dict[str, DataType]) – A mapping between column names and datatypes - passing this option will disable all schema inference on data being read, and throw an error if data being read is incompatible.

  • fs (fsspec.AbstractFileSystem) – fsspec FileSystem to use for reading data. By default, Daft will automatically construct a FileSystem instance internally.

Returns

parsed DataFrame

Return type

DataFrame