mirror of
https://github.com/nushell/nushell.git
synced 2025-05-09 20:44:29 +02:00
# Description This PR introduces `polars struct-encode-json`. This exposes the ability to encode struct columns as json strings. This is useful when converting things to formats like CSV that do not support complex types. ```nushell > ❯ : [[id person]; [1 {name: "Bob", age: 36}] [2 {name: "Betty", age: 63}]] | polars into-df -s {id: i64, person: {name: str, age: u8}} | polars select id (polars col person | polars struct-json-encode | polars as encoded) | polars collect ╭───┬────┬───────────────────────────╮ │ # │ id │ encoded │ ├───┼────┼───────────────────────────┤ │ 0 │ 1 │ {"age":36,"name":"Bob"} │ │ 1 │ 2 │ {"age":63,"name":"Betty"} │ ╰───┴────┴───────────────────────────╯ ``` # User-Facing Changes * Added `polars struct-encode-json`, providing the ability to encode structs as json |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE |