Skip to content

API: NaTType and NAType are in inconsistent packages #53934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Dr-Irv opened this issue Jun 29, 2023 · 1 comment · Fixed by #53958
Closed

API: NaTType and NAType are in inconsistent packages #53934

Dr-Irv opened this issue Jun 29, 2023 · 1 comment · Fixed by #53958
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Typing type annotations, mypy/pyright type checking

Comments

@Dr-Irv
Copy link
Contributor

Dr-Irv commented Jun 29, 2023

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.

@Dr-Irv Dr-Irv added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Typing type annotations, mypy/pyright type checking labels Jun 29, 2023
@rhshadrach
Copy link
Member

Adding to typing makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants