Expand description
A stored value as text, exactly, apart from how the table previews it.
The table’s preview rounds floats, groups digits and cuts long text to fit a
cell; a copy or the inspector gives back what is stored. A float is the
shortest decimal that reads back to the same bits, never Polars’ compact
display; a datetime carries every digit of its unit and its zone’s offset.
Exact means the stored value: a CSV’s 1.50 was stored as 1.5.
Structs§
- Bounded
- Text cut to a byte budget, and whether anything was cut.
- Text
Facts - The facts about text that its look on screen hides: how long it is, how many lines it runs to, and whitespace at either end.
Constants§
- CELL_
PREVIEW_ BYTES - Bytes of a value a table cell previews: more than any terminal row draws.
Functions§
- base64_
text - Bytes as base64, the spelling every copy and export of a binary uses.
- calendar_
without_ out_ of_ range - A date, datetime or time column with each value
out_of_rangenames as null, for the Polars operations that overflow or panic on one.Nonewhen it holds none, the common case, which costs a min and a max. - cell_
preview previewof the start ofs, ending in the ellipsis when cut: a cell draws only its start, and measuring a huge value whole every frame costs what the value costs.- copy_
len_ floor - At least how many bytes
copy_textwrites forvalue, counted only until the count passesstop: a copy can be refused at a cap before it is formatted, and a million-item list is not walked to learn that it is over. Text is its length and bytes their base64; a list or struct is counted from its punctuation and leaves, each at its shortest JSON. - copy_
text - One cell of a one-row column as copy text: exact scalars, nested values as the JSON an export writes, bytes as base64, a null as empty.
- escape_
char - One character of
escaped’s literal, without the quotes around it: the inspector escapes a long value a piece at a time. - escaped
sas a quoted literal: backslash, quote, line breaks, tabs and every invisible character written as an escape, so a literal\nin the data ("\\n") never reads as a line break, and leading or trailing spaces and an empty string show by the quotes around them.- escaped_
bytes - Bytes as a quoted literal: printable ASCII as itself, the rest as
\xNN. - f32_
text f64_textfor anf32, shortest at thef32’s own precision: widened tof64first,0.1f32would read0.10000000149011612.- f64_
text - The shortest decimal that parses back to
v: plain notation over the magnitudes people read as plain numbers, exponent notation outside them. NaN, the infinities and negative zero are spelled out rather than lost. - holds_
calendar - Whether
dtypeis, or holds, a date, datetime or time. - is_
nested_ value - Whether
valueis a list, array or struct. - list_
preview - How the table previews a list cell: its first ten items, and how many there
are when that is not all of them (
[a, b...] (12 items)). - marked
- Whether a one-line cell draws
cas a mark rather than as itself: a control character, which a cell cannot draw, or a direction control, which a terminal that lays out bidirectional text would apply to the rest of the row. - nested_
compact - A list, array or struct on one line, stopping once
budgetbytes are written: for a preview, which shows only the start. - nested_
len - How many items a list or array holds, or fields a struct has.
- nested_
pretty - A list, array or struct laid out one item per line, indented, stopping once
budgetbytes are written. Scalars inside are exact; text is quoted and escaped so an item’s edges are visible. - out_
of_ range - A date, datetime or time outside the calendar’s range, as its stored number:
Polars panics formatting one (a sentinel like
i64::MINmicroseconds is real data). A day of margin either side leaves room for a zone’s offset. - past_
calendar_ text - The text
str_valuegives a value Polars panics formatting: a date past the calendar, or a list or struct holding one.Nonefor any other value, which Polars formats as usual. - prefix
- The longest prefix of
sno longer thanbudgetbytes, cut at a character boundary. - preview
- One-line preview of
s: a line break, a tab or anothermarkedcharacter becomes a mark from the glyph set, soline1\nline2does not read asline1line2. A\r\npair is one break. - stored_
out_ of_ range out_of_rangefor a value ofdtypestored as the numberstored.- str_
value AnyValue::str_value, which panics on a date past the calendar, with such a value written as its stored number, and a list or struct holding one written asnested_compactdoes.- text_
facts - value_
text - A value as exact text. A null is empty, as in an export; a list or struct is compact JSON-like text over exact scalars; bytes are base64.