Expand description
List, array and struct cells as JSON text for one-value-per-field destinations (CSV
export, clipboard copies): JSON keeps struct field names and reads back anywhere
(str.json_decode). The text is Polars’ JSON writer’s, as in NDJSON export.
Special cases where Polars’ writers panic or have no form: binary is standard base64
everywhere; dates and ms/µs datetimes go in as their written text (values past the
calendar as their stored number, as the table shows; ns is always in range);
durations are ISO 8601 seconds as the JSON writer spells them (PT3723.004S,
-PT1.5S, P0D), exact to the nanosecond.
Enums§
- Writer
- The writer whose text for a date or datetime
calendar_as_textwrites.
Functions§
- calendar_
as_ text - A date or datetime column as the text
writerwrites for it, with its nulls; a value past the calendar’s range, on which the writers panic, as its stored number (crate::exact::out_of_range), as the table shows it. - column_
as_ json - One nested column as a String column of JSON, null where the value is null.
- duration_
as_ iso - A duration column as a String column of
duration_isotext, with its nulls. - duration_
iso valueunits as ISO 8601, as Polars’ JSON writer (chrono’sTimeDelta) spells it: whole seconds plus significant fraction digits,P0Dfor zero,-when negative. Computed here: chrono’s range stops short ofi64::MINms.- frame_
as_ cells frame_as_jsonwith dates and datetimes kept in their own type: the cells a Markdown or HTML copy writes throughcrate::exact::value_text, which spells one past the calendar as its stored number itself.- frame_
as_ json lazy_as_jsonfor frames already in memory: a copy’s rows, as the CSV writer takes them.- has_
binary - Whether
dtypeis binary or has binary anywhere inside. - is_
nested - Whether a column is a list, array or struct, which a delimited writer takes only as JSON text.
- lazy_
as_ json lfwith every column a CSV writer cannot take (needs_text) replaced by its text, in place and under its own name: what a CSV export writes. Planned, not run: the text is built as the rows are collected.- lazy_
for_ json lfwith every column that has binary, a date or a datetime in it as text (leaves_as_json_text), in place and under its own name: what a JSON export writes. Planned, not run.- leaves_
as_ json_ text serieswith every binary value, at any depth, as its base64 text, and every date and datetime as the JSON writer’s text (calendar_as_text). Lists, arrays and structs keep their shape and their nulls.- needs_
text - Whether a column needs to become text before a CSV writer takes it: it is nested, binary, a duration, or a date or datetime in ms or us, which the writer can panic on.