[FEA] Add bindings to Series getJSONObject query
trxcllnt opened this issue · comments
Paul Taylor commented
Given the prevalence of JSON in JavaScript, it'd be awesome if we added bindings to the cudf::get_json_object()
method.
This would allow us to query a StringSeries of JSON lines for JSON paths:
import { Series } from '@rapidsai/cudf';
const lines = Series.new([
{foo: {bar: "baz"}},
{foo: {baz: "bar"}},
].map(JSON.stringify))
console.log([...lines.getJSONObject(`foo`)].map(JSON.parse)) // [{ "bar": "baz" }, { "baz": "bar" }]
console.log([...lines.getJSONObject(`foo.bar`)]) // ["baz", ""]