Skip to content
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

use strict typing for tslibs/nattype and tslibs/dtypes #1155

Merged
merged 3 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions pandas-stubs/_libs/tslibs/dtypes.pyi

This file was deleted.

12 changes: 8 additions & 4 deletions pandas-stubs/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyright: strict
from datetime import (
datetime,
timedelta,
Expand All @@ -11,7 +12,10 @@ from typing_extensions import (
)

from pandas._libs.tslibs.period import Period
from pandas._typing import TimeUnit
from pandas._typing import (
NpDtype,
TimeUnit,
)

NaT: NaTType
iNaT: int
Expand All @@ -30,7 +34,7 @@ class NaTType:
def asm8(self) -> np.datetime64: ...
def to_datetime64(self) -> np.datetime64: ...
def to_numpy(
self, dtype: np.dtype | str | None = ..., copy: bool = ...
self, dtype: NpDtype | None = ..., copy: bool = ...
) -> np.datetime64 | np.timedelta64: ...
@property
def is_leap_year(self) -> bool: ...
Expand Down Expand Up @@ -67,8 +71,8 @@ class NaTType:
def weekday(self) -> float: ...
def isoweekday(self) -> float: ...
def total_seconds(self) -> float: ...
def today(self, *args, **kwargs) -> NaTType: ...
def now(self, *args, **kwargs) -> NaTType: ...
def today(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
def now(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
def to_pydatetime(self) -> NaTType: ...
def date(self) -> NaTType: ...
def round(self) -> NaTType: ...
Expand Down