polars/polars-builtin-on-expr-or-series
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Polars | error | unsafe, with xpd check --fix --unsafe-fixes |
All versions |
Polars 2.1.0 raises TypeError when this Python builtin tries to size or iterate an Expr. Use the corresponding expression method.
len(expr)expr.len()What the rule reports
Section titled “What the rule reports”Five TypeError results on Expr. All five builtins worked on Series.
How to fix it
Section titled “How to fix it”Use xpd check --fix --unsafe-fixes to replace the Python builtin with the matching Polars expression method.
Diagnostic message
Section titled “Diagnostic message”Polars 2.1.0 raises TypeError when this Python builtin tries to size or iterate an Expr. Use the corresponding expression method.See all rules in the Polars pack.