Skip to content

PD003 raise an error for xarray.DataArray #8846

@seisman

Description

@seisman

Minimal code snippet to reproduce the bug:

import numpy as np
import xarray as xr

array = xr.DataArray([1, np.nan, 3], dims="x")
array.isnull()

The command:

$ ruff check test.py --select=PD --show-source --isolated
test.py:5:1: PD003 `.isna` is preferred to `.isnull`; functionality is equivalent
  |
4 | array = xr.DataArray([1, np.nan, 3], dims="x")
5 | array.isnull()
  | ^^^^^^^^^^^^ PD003
  |

Found 1 error.

ruff version:

$ ruff --version 
ruff 0.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtype-inferenceRequires more advanced type inference.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions