json#

class pylibcudf.json.GetJsonObjectOptions(allow_single_quotes=False, *, strip_quotes_from_single_strings=True, missing_fields_as_nulls=False)#

Settings for get_json_object()

Methods

get_allow_single_quotes(self)

Returns true/false depending on whether single-quotes for representing strings are allowed.

get_missing_fields_as_nulls(self)

Whether a field not contained by an object is to be interpreted as null.

get_strip_quotes_from_single_strings(self)

Returns true/false depending on whether individually returned string values have their quotes stripped.

set_allow_single_quotes(self, bool val)

Set whether single-quotes for strings are allowed.

set_missing_fields_as_nulls(self, bool val)

Set whether missing fields are interpreted as null.

set_strip_quotes_from_single_strings(self, ...)

Set whether individually returned string values have their quotes stripped.

get_allow_single_quotes(self)#

Returns true/false depending on whether single-quotes for representing strings are allowed.

Returns:
bool

true if single-quotes are allowed, false otherwise.

get_missing_fields_as_nulls(self)#

Whether a field not contained by an object is to be interpreted as null.

Returns:
bool

true if missing fields are interpreted as null.

get_strip_quotes_from_single_strings(self)#

Returns true/false depending on whether individually returned string values have their quotes stripped.

Returns:
bool

true if individually returned string values have their quotes stripped.

set_allow_single_quotes(self, bool val)#

Set whether single-quotes for strings are allowed.

Parameters:
valbool

Whether to allow single quotes

Returns:
None
set_missing_fields_as_nulls(self, bool val)#

Set whether missing fields are interpreted as null.

Parameters:
valbool

Whether to treat missing fields as nulls.

Returns:
None
set_strip_quotes_from_single_strings(self, bool val)#

Set whether individually returned string values have their quotes stripped.

Parameters:
valbool

Whether to strip quotes from single strings.

Returns:
None
pylibcudf.json.get_json_object(Column col, Scalar json_path, GetJsonObjectOptions options=None) Column#

Apply a JSONPath string to all rows in an input strings column.

For details, see cudf::get_json_object()

Parameters:
colColumn

The input strings column. Each row must contain a valid json string.

json_pathScalar

The JSONPath string to be applied to each row.

optionsGetJsonObjectOptions

Options for controlling the behavior of the function.

Returns:
Column

New strings column containing the retrieved json object strings.