Skip to content

Commit 136b20c

Browse files
fangchenliJulianWgs
authored andcommitted
TYP: use type annotations in vectorized.pyi (pandas-dev#41774)
1 parent 3151692 commit 136b20c

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

pandas/_libs/tslibs/vectorized.pyi

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
For cython types that cannot be represented precisely, closest-available
33
python equivalents are used, and the precise types kept as adjacent comments.
44
"""
5+
from __future__ import annotations
6+
57
from datetime import tzinfo
6-
from typing import (
7-
Optional,
8-
Union,
9-
)
108

119
import numpy as np
1210

@@ -16,32 +14,24 @@ from pandas._libs.tslibs.offsets import BaseOffset
1614
def dt64arr_to_periodarr(
1715
stamps: np.ndarray, # const int64_t[:]
1816
freq: int,
19-
tz: Optional[tzinfo],
17+
tz: tzinfo | None,
2018
) -> np.ndarray: ... # np.ndarray[np.int64, ndim=1]
21-
22-
2319
def is_date_array_normalized(
2420
stamps: np.ndarray, # const int64_t[:]
25-
tz: Optional[tzinfo] = None,
21+
tz: tzinfo | None = None,
2622
) -> bool: ...
27-
28-
2923
def normalize_i8_timestamps(
3024
stamps: np.ndarray, # const int64_t[:]
31-
tz: Optional[tzinfo],
25+
tz: tzinfo | None,
3226
) -> np.ndarray: ... # np.ndarray[np.int64]
33-
34-
3527
def get_resolution(
3628
stamps: np.ndarray, # const int64_t[:]
37-
tz: Optional[tzinfo] = None,
29+
tz: tzinfo | None = None,
3830
) -> Resolution: ...
39-
40-
4131
def ints_to_pydatetime(
4232
arr: np.ndarray, # const int64_t[:}]
43-
tz: Optional[tzinfo] = None,
44-
freq: Optional[Union[str, BaseOffset]] = None,
33+
tz: tzinfo | None = None,
34+
freq: str | BaseOffset | None = None,
4535
fold: bool = False,
4636
box: str = "datetime",
4737
) -> np.ndarray: ... # np.ndarray[object]

0 commit comments

Comments
 (0)