Method: Polars::StringExpr#json_decode
- Defined in:
- lib/polars/string_expr.rb
#json_decode(dtype, infer_schema_length: nil) ⇒ Expr
Parse string values as JSON.
Throw errors if encounter invalid JSON strings.
960 961 962 963 964 965 966 967 968 |
# File 'lib/polars/string_expr.rb', line 960 def json_decode(dtype, infer_schema_length: nil) if dtype.nil? msg = "`Expr.str.json_decode` needs an explicitly given `dtype` otherwise Polars is not able to determine the output type. If you want to eagerly infer datatype you can use `Series.str.json_decode`." raise TypeError, msg end dtype_expr = Utils.parse_into_datatype_expr(dtype)._rbdatatype_expr Utils.wrap_expr(_rbexpr.str_json_decode(dtype_expr)) end |