Skip to content

Commit 831d184

Browse files
committed
Add unit property and as_unit method to NaTType
1 parent 40d9636 commit 831d184

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pandas-stubs/_libs/tslibs/nattype.pyi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ from datetime import (
33
timedelta,
44
tzinfo as _tzinfo,
55
)
6+
from typing import Literal
67

78
import numpy as np
8-
from typing_extensions import TypeAlias
9+
from typing_extensions import (
10+
Self,
11+
TypeAlias,
12+
)
913

1014
from pandas._libs.tslibs.period import Period
1115

@@ -121,3 +125,8 @@ class NaTType:
121125
__le__: _NatComparison
122126
__gt__: _NatComparison
123127
__ge__: _NatComparison
128+
@property
129+
def unit(self) -> str: ...
130+
def as_unit(
131+
self, unit: Literal["s", "ms", "us", "ns"], round_ok: bool = ...
132+
) -> Self: ...

0 commit comments

Comments
 (0)