Skip to content

polars/polars-null-comparison

Rule polars-null-comparison
Pack Polars
Severity warning
Fix unsafe, with xpd check --fix --unsafe-fixes
Library versions every version

Polars 2.1.0 emits UserWarning for comparison to None. Use is_null to test for nulls.

expr == None
expr.is_null()
Form Replacement example Proof on 2.1.0
expr == None expr.is_null() UserWarning under -W error
expr != None expr.is_not_null() UserWarning under -W error

Use xpd check --fix --unsafe-fixes to apply the offered rewrite after checking the intended result.

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

Polars 2.1.0 emits UserWarning for comparison to None. Use is_null to test for nulls.

Browse the other rules of the Polars pack.