Skip to content

Commit dc84f57

Browse files
committed
Add unit property and as_unit method to TimelikeOps
1 parent c9c056a commit dc84f57

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas-stubs/core/arrays/datetimelike.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from collections.abc import Sequence
2+
from typing import Literal
23

34
import numpy as np
45
from pandas.core.arrays.base import (
56
ExtensionArray,
67
ExtensionOpsMixin,
78
)
9+
from typing_extensions import Self
810

911
from pandas._libs import (
1012
NaT as NaT,
@@ -15,6 +17,9 @@ class DatelikeOps:
1517
def strftime(self, date_format): ...
1618

1719
class TimelikeOps:
20+
@property
21+
def unit(self) -> str: ...
22+
def as_unit(self, unit: Literal["s", "ms", "us", "ns"]) -> Self: ...
1823
def round(self, freq, ambiguous: str = ..., nonexistent: str = ...): ...
1924
def floor(self, freq, ambiguous: str = ..., nonexistent: str = ...): ...
2025
def ceil(self, freq, ambiguous: str = ..., nonexistent: str = ...): ...

0 commit comments

Comments
 (0)