← All recipes
Moderne licensed

Use .isna() instead of == np.nan comparisons

Recipe IDorg.openrewrite.python.cleanup.UseIsnaArtifactopenrewrite-static-analysis

Rewrite == 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.UseIsna

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-static-analysis