exprs¶
Allow user-friendly short DSL expressions that get expanded to pl.col syntax.
expand_short_expr ¶
Convert DSL tokens like '{name}' into 'pl.col("name")' for Polars expressions.
Example: '{name}.str.startswith("a")' -> 'pl.col("name").str.startswith("a")'.
Source code in src/octopols/exprs.py
prepare_expr ¶
Prepare a Polars expression from either a string DSL or an existing pl.Expr.
Evaluates the DSL expression if given a string, expanding short filter tokens, and returns the resulting Polars expression. Returns None if expr is None.