Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.Advanced TutorialsBuild end-to-end workflows between two specific systems.API ReferenceCLI ReferenceRelease Notes
Version: 2.0.0

lit

function
def lit(
value: Any,
dtype: PolarsDataType | None = None,
*,
allow_object: bool = False,
) -> Expr

Categories: generation

Build an expression from a literal (constant) value.

Use it to add or compare against constant values in select / with_columns / filter.

Parameters

parameter
valueAny

The literal value.

parameter
dtypePolarsDataType | None (DataType | None)

Data type for the literal; inferred from value when omitted.

parameter
allow_objectbool

Allow storing an arbitrary Python object as the value.

Examples

tf.with_columns(lit(7).alias("c"))
tf.select(lit(1.5).alias("r"))