Skip to content

polars/polars-expr-mask-precedence

Pack Severity Fix Versions
Polars error unsafe, with xpd check --fix --unsafe-fixes All versions

Polars 2.1.0 raises TypeError for this unparenthesized mask. Enclose each comparison in parentheses before combining it.

expr > 0 & expr < 5
(expr > 0) & (expr < 5)

TypeError from chained comparison truth testing.

Use xpd check --fix --unsafe-fixes to parenthesize each comparison around &, |, or ^.

Polars 2.1.0 raises TypeError for this unparenthesized mask. Enclose each comparison in parentheses before combining it.

See all rules in the Polars pack.