Skip to main content

Module column_types

Module column_types 

Source
Expand description

A column’s declared type: one vocabulary for the type row, a delimited spec’s [columns], the typing of text columns, and a column retyped in the table.

ColumnType is a type name and, for the temporal ones, a strftime format, read from and written as the inline table a spec entry uses: { type = "date", format = "%d/%m/%Y" }. ColumnType::expr turns a column into it, lazily and never failing: a value that does not fit is null. ColumnType::unfit counts those values, for the note that says so (unfit_notes).

Structs§

ColumnChange
A change to a view’s columns, by name: a type, or a column made from others, as a spec’s [columns] entry says it.
ColumnType
A column’s declared type.
Derived
A column built from others: time = { from = ["Date", "Time", "Offset"], as = "datetime" }.
Typed
A column given a type, and the type it had before: what unfit_frame counts.
Unfit
The values a column’s type made null: those that are not of it, and those out of its range.

Enums§

Change
DerivedKind
What a derived column is.

Constants§

DATETIME_FORMATS
The datetime formats, as DATE_FORMATS.
DATE_FORMATS
The date formats read.infer_types tries and a retype offers, most common first.
TIME_FORMATS
The time formats, as DATE_FORMATS.
TYPE_NAMES
The type names, as the type row shows them and a spec or a picker takes them.

Functions§

dtype_label
The short name of a column’s type, as the type row and the schema pane spell it.
dtype_named
The type a name in TYPE_NAMES stands for.
durations
Text in Polars’ duration format (1d, 2h30m, -1w2d) as nanoseconds. A value that does not parse is null.
formats_reading
The formats of a temporal dtype that read sample, in the order they are tried.
has_leading_zero
Whether value starts with a zero another digit follows, as 02134, 007 and -01 do and 0, 0.5, -0.5 and 0e3 do not: a code or an ID, kept as text rather than read as a number.
preview
value read as ty, as the table would show it: 2024-03-04 for 03/04/2024 as a date with %d/%m/%Y. None when it does not read.
unfit_counts
The counts in counted, the one row unfit_frame collects, for typed.
unfit_frame
One pass over source, the frame before the columns of typed were typed, that counts the values each one made null.
unfit_notes
A note a column, for each column whose type made values null: LogIdx: 3 values not i64, read as null, RPM: 2 values out of range for u8, read as null.