Skip to main content

Module typed_value

Module typed_value 

Source
Expand description

Text typed as a value for a column, read as the column’s own type.

A filter and a Data Quality partition compare a column with a value someone typed. Compared as text it either fails (Polars will not compare a date with a string) or casts every row to text, which costs a pass over the column and blinds Parquet statistics and SQLite to the predicate. Read here into a literal of the column’s type, col op lit stays a plain comparison.

Functions§

parse
text as a literal of dtype: a number, a flag, a date, a date and time read as a clock in the column’s zone, a time, a duration or a decimal at the column’s scale. Text and categories stay text. The error says what text should look like.
python
A literal as Python Polars: pl.date(2024, 1, 1), pl.datetime(...), pl.duration(...), a number, a string.
text_of
The text parse reads back to exactly value, a value of dtype: what + and - put in a filter. A float is its shortest exact decimal, a date and time its clock in the column’s zone to the last digit (with its offset where that clock happens twice). None for a null, and for a type parse does not read.
written_as
The forms a value of dtype is written in, for a message about one that is not.