json#

class pylibcudf.json.GetJsonObjectOptions(
bool allow_single_quotes: bool = False,
*,
bool strip_quotes_from_single_strings: bool = True,
bool missing_fields_as_nulls: bool = 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) bool#

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) bool#

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,
) bool#

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) None#

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,
) None#

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,
) None#

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,
stream: CudaStreamLike | None = None,
DeviceMemoryResource mr=None,
) Column#

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

For details, see 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.

streamStream | None

CUDA stream on which to perform the operation.

Returns:
Column

New strings column containing the retrieved json object strings.