lit method

Expr lit(
  1. Object? value, [
  2. DType? dtype
])

Creates a literal expression from a Dart value.

Pass dtype to choose the Polars type explicitly instead of inferring it from the Dart value.

Implementation

Expr lit(Object? value, [DType? dtype]) {
  final scalar = _scalar(value, dtype);
  return _adoptExpr(
    _client.invokeSync('exprLiteral', {'scalar': scalar.toJson()}),
  );
}