snowflake.snowpark.functions.try_parse_json

snowflake.snowpark.functions.try_parse_json(e: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.35.0/src/snowflake/snowpark/functions.py#L6798-L6817)

Parse the value of the specified column as a JSON string and returns the resulting JSON document. Returns NULL if an error occurs during parsing.

Example::
>>> df = session.create_dataframe([['{"key": "1"}'], ['{"Open": "parenthesis"']], schema=["a"])
>>> df.select(try_parse_json(df["a"]).alias("result")).show()
----------------
|"RESULT"      |
----------------
|{             |
|  "key": "1"  |
|}             |
|NULL          |
----------------
Copy
Language: English