pyarrow.json.ParseOptions

class pyarrow.json.ParseOptions(explicit_schema=None, newlines_in_values=None, unexpected_field_behavior=None)

Bases: pyarrow.lib._Weakrefable

Options for parsing JSON files.

Parameters
  • explicit_schema (Schema, optional (default None)) – Optional explicit schema (no type inference, ignores other fields).

  • newlines_in_values (bool, optional (default False)) – Whether objects may be printed across multiple lines (for example pretty printed). If false, input must end with an empty line.

  • unexpected_field_behavior (str, default "infer") –

    How JSON fields outside of explicit_schema (if given) are treated.

    Possible behaviors:

    • ”ignore”: unexpected JSON fields are ignored

    • ”error”: error out on unexpected JSON fields

    • ”infer”: unexpected JSON fields are type-inferred and included in the output

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(*args, **kwargs)

Initialize self.

Attributes

explicit_schema

Optional explicit schema (no type inference, ignores other fields)

newlines_in_values

Whether newline characters are allowed in JSON values.

unexpected_field_behavior

How JSON fields outside of explicit_schema (if given) are treated.

explicit_schema

Optional explicit schema (no type inference, ignores other fields)

newlines_in_values

Whether newline characters are allowed in JSON values. Setting this to True reduces the performance of multi-threaded JSON reading.

unexpected_field_behavior

How JSON fields outside of explicit_schema (if given) are treated.

Possible behaviors:

  • “ignore”: unexpected JSON fields are ignored

  • “error”: error out on unexpected JSON fields

  • “infer”: unexpected JSON fields are type-inferred and included in the output

Set to “infer” by default.