Use .isna() instead of == np.nan comparisons
Recipe ID
org.openrewrite.python.cleanup.UseIsnaArtifactopenrewrite-static-analysisRewrite == np.nan and == numpy.nan equality tests as .isna() calls, since direct NaN comparison always evaluates to False.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.python.cleanup.UseIsnaIf the recipe isn’t available locally, install it with:
mod config recipes pip install openrewrite-static-analysis