Skip to content

API: NaTType and NAType are in inconsistent packages #53934

Closed
@Dr-Irv

Description

@Dr-Irv

If you are adding type checking to your application, you may need access to NaTType and NAType. But their locations are in inconsistent packages. The following imports work:

from pandas._libs import NaTType
from pandas._libs.missing import NAType

Should NAType be in pandas._libs if NaTType is?

Note - we don't document these two types, but we use those types in pandas-stubs so if someone was looking at the stubs and wanted to include typing in user code, then the difference in imports would look odd.

Another option is to add these to pandas.api.typing . Would like opinion of @rhshadrach on that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateTypingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions