bigframes.bigquery.json_keys#

bigframes.bigquery.json_keys(input: Series, max_depth: int | None = None) Series[source]#

Returns all keys in the root of a JSON object as an ARRAY of STRINGs.

Examples:

>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> s = bpd.Series(['{"b": {"c": 2}, "a": 1}'], dtype="json")
>>> bbq.json_keys(s)
0    ['a' 'b' 'b.c']
dtype: list<item: string>[pyarrow]
Parameters:
  • input (bigframes.series.Series) – The Series containing JSON data.

  • max_depth (int, optional) – Specifies the maximum depth of nested fields to search for keys. If not provided, searched keys at all levels.

Returns:

A new Series containing arrays of keys from the input JSON.

Return type:

bigframes.series.Series